473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

sending email from outlook

The following code wrks fine when running from my pc (localhost); but errors
when I put the asp.net code up to the production web server. Theerror I get
is System.Runtime.InteropServices.COMException: COM Object ... is either not
valid or not registered.

What am I missing?
My code:
Public Function CallOutlook()

Dim oOutlook As New Outlook.Application()

Dim oMailitem As Outlook.MailItem

oMailitem = oOutlook.CreateItem(Outlook.OlItemType.olMailItem)

oMailitem.To = a@a.com

oMailitem.Cc = b@b.com

oMailitem.Subject = "Email Integration with Outlook and VB.Net"

oMailitem.Display()

End Function


Aug 31 '06 #1
6 1407
"KatMagic" <SS********@yahoo.comwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
What am I missing?
Well, first things first, why are you trying to instantiate Outlook on a web
server...?
Aug 31 '06 #2
Because we have a web application where we want our users to click on a link
to open an outlook email and send an email. What other reason would there
be. This is an internal server, not used by anyone other than our own
employess.
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
"KatMagic" <SS********@yahoo.comwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
>What am I missing?

Well, first things first, why are you trying to instantiate Outlook on a
web server...?

Sep 1 '06 #3
I think the response you received is referring to the fact that this will do
absolutely nothing for a user because it is on the web server. This is not
going to create an outlook email that the user can do anything with. This is
trying to instantiate an instance of Outlook on the web server itself. The
user would never see this and it wouldn't open an email for the user since
it is not going to happen on the users computer. The best thing you can do
is to create a hyperlink and use the "mailto:" version so that it will open
an email message in the user's default email client.

You can specify one user to send it to as follows:

mailto:b@b.com

The specifications say that you cannot use more than one address to send to,
though a lot of people do this simply by adding comma's between them. This
is not supported though and is not part of the RFC that governs how a URL
should appear so use a comma delimited list with caution. You can add a
subject by placing ?subject= followed by the subject like so:

mailto:b@b.com?subject=Email Integration with Outlook and VB.Net

The subject isn't supported either, but a lot of clients do support it.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"KatMagic" <SS********@yahoo.comwrote in message
news:un**************@TK2MSFTNGP05.phx.gbl...
Because we have a web application where we want our users to click on a
link to open an outlook email and send an email. What other reason would
there be. This is an internal server, not used by anyone other than our
own employess.
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>"KatMagic" <SS********@yahoo.comwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
>>What am I missing?

Well, first things first, why are you trying to instantiate Outlook on a
web server...?


Sep 1 '06 #4
"KatMagic" <SS********@yahoo.comwrote in message
news:un**************@TK2MSFTNGP05.phx.gbl...
Because we have a web application where we want our users to click on a
link to open an outlook email and send an email. What other reason would
there be. This is an internal server, not used by anyone other than our
own employess.
Oh right - so your employees all use the webserver as their desktop
workstation...?
Sep 1 '06 #5
outlook requires user profile. web applications do not have one. also you
are calling display, which if it worked (won't because web apps do not have
access o the desktop) , wuld popup the mail dialog on the server.

-- bruce (sqlwork.com)

"KatMagic" <SS********@yahoo.comwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...
The following code wrks fine when running from my pc (localhost); but
errors when I put the asp.net code up to the production web server.
Theerror I get is System.Runtime.InteropServices.COMException: COM Object
... is either not valid or not registered.

What am I missing?
My code:
Public Function CallOutlook()

Dim oOutlook As New Outlook.Application()

Dim oMailitem As Outlook.MailItem

oMailitem = oOutlook.CreateItem(Outlook.OlItemType.olMailItem)

oMailitem.To = a@a.com

oMailitem.Cc = b@b.com

oMailitem.Subject = "Email Integration with Outlook and VB.Net"

oMailitem.Display()

End Function


Sep 1 '06 #6
You're right, I wasn't understanding it like I should have, I was taking it
from a windows app. However, when I search for "Using Outlook with
ASP.NET", this is the code I got. But thanks for making this clear. I get
it now. This is just what I needed!

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:ug**************@TK2MSFTNGP02.phx.gbl...
>I think the response you received is referring to the fact that this will
do absolutely nothing for a user because it is on the web server. This is
not going to create an outlook email that the user can do anything with.
This is trying to instantiate an instance of Outlook on the web server
itself. The user would never see this and it wouldn't open an email for the
user since it is not going to happen on the users computer. The best thing
you can do is to create a hyperlink and use the "mailto:" version so that
it will open an email message in the user's default email client.

You can specify one user to send it to as follows:

mailto:b@b.com

The specifications say that you cannot use more than one address to send
to, though a lot of people do this simply by adding comma's between them.
This is not supported though and is not part of the RFC that governs how a
URL should appear so use a comma delimited list with caution. You can add
a subject by placing ?subject= followed by the subject like so:

mailto:b@b.com?subject=Email Integration with Outlook and VB.Net

The subject isn't supported either, but a lot of clients do support it.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"KatMagic" <SS********@yahoo.comwrote in message
news:un**************@TK2MSFTNGP05.phx.gbl...
>Because we have a web application where we want our users to click on a
link to open an outlook email and send an email. What other reason would
there be. This is an internal server, not used by anyone other than our
own employess.
"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>>"KatMagic" <SS********@yahoo.comwrote in message
news:eX**************@TK2MSFTNGP02.phx.gbl...

What am I missing?

Well, first things first, why are you trying to instantiate Outlook on a
web server...?



Sep 1 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
1
by: Devonish | last post by:
I am composing an email with Access VB and then sending it from within Access. Everything works correctly (the email actually goes!) but Outlook ask some irritating questions that the user is...
17
by: Bonj | last post by:
Right guys. (I would like a solution to this in VB6 as this is what our needy app is written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate...
8
by: Frank | last post by:
I think I've confused myself completely here :-) I have used System.Web.Mail, but am not sure if this works with Exchange Server 5.5. I asked the client if they're email server supported SMTP, and...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
7
by: Paridevi | last post by:
Hai , i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.