472,371 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

outlook email from a .net Web Form

I am unsuccessfullly trying to display an outlook email
from a vb web forms (.net) outlook 2002

#1. is it possible to use outlook client email from a web
form using the outlook object model within vb .net for
web forms?

#2. If not what is recommended (SMTP has problems if the
address are not correct). I also have used the Mailto:
but am having problems passing the body with formating
urlencode puts + all over.
here is the code attempting the outlook model:

Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "t_***@email.msn.com"
objMail.cc = "" 'Enter an address here To include
a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body

strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
i get this error:

Cannot create ActiveX component.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Exception: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("Outlook.Application")
Line 183: objMail = objOutlk.createitem(olMailItem)
Line 184: objMail.To = "t_***@email.msn.com"

is there something special i have to do to get outlook to
work - set impersonate = true in the web.config?

thanks for any help!
Jul 21 '05 #1
3 5781
Why not use System.Web.Mail?
-----Original Message-----
I am unsuccessfullly trying to display an outlook email
from a vb web forms (.net) outlook 2002

#1. is it possible to use outlook client email from a webform using the outlook object model within vb .net for
web forms?

#2. If not what is recommended (SMTP has problems if the
address are not correct). I also have used the Mailto:
but am having problems passing the body with formating
urlencode puts + all over.
here is the code attempting the outlook model:

Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "t_***@email.msn.com"
objMail.cc = "" 'Enter an address here To includea carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body

strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
i get this error:

Cannot create ActiveX component.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Exception: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("Outlook.Application")
Line 183: objMail = objOutlk.createitem(olMailItem)
Line 184: objMail.To = "t_***@email.msn.com"

is there something special i have to do to get outlook towork - set impersonate = true in the web.config?

thanks for any help!
.

Jul 21 '05 #2
Thanks for the quick reply.

I do use it now but i want to open an outlook mail
message so it can verify the addresses that i pre-
populate, also why re-invent the wheel? i have my own web
form that has all the same things (minus a bunch) that
outlook has. Now users want spell check, address
verification....in other words a fully functional email
system (like outlook :))

Do you know if its possible to use the outlook object
model from a vb Web Form?
-----Original Message-----
Why not use System.Web.Mail?
-----Original Message-----
I am unsuccessfullly trying to display an outlook email
from a vb web forms (.net) outlook 2002

#1. is it possible to use outlook client email from a

web
form using the outlook object model within vb .net for
web forms?

#2. If not what is recommended (SMTP has problems if theaddress are not correct). I also have used the Mailto:
but am having problems passing the body with formating
urlencode puts + all over.
here is the code attempting the outlook model:

Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "t_***@email.msn.com"
objMail.cc = "" 'Enter an address here To

include
a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body

strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
i get this error:

Cannot create ActiveX component.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Exception: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject ("Outlook.Application")Line 183: objMail = objOutlk.createitem(olMailItem)
Line 184: objMail.To = "t_***@email.msn.com"

is there something special i have to do to get outlook

to
work - set impersonate = true in the web.config?

thanks for any help!
.

.

Jul 21 '05 #3
Chuck,
I would not recommend attempting to run Outlook in your VB.NET running on
the Web Server, as the user would not be able to see it! The other major
problem is Outlook requires a Profile, and the account the Web Server
normally runs under does not have a profile configured...

You may be able to use some JavaScript or VBScript in your form to cause
Outlook to come up on the client side, assuming they have Outlook loaded.
Remember this would need to be runat=client script!

I have not tried it, could you redirect to "mailto" url so the mail client
on the client machine came up with a message form?

Hope this helps
Jay

"Chuck Farah" <cf*******@whatever.com> wrote in message
news:0d****************************@phx.gbl...
I am unsuccessfullly trying to display an outlook email
from a vb web forms (.net) outlook 2002

#1. is it possible to use outlook client email from a web
form using the outlook object model within vb .net for
web forms?

#2. If not what is recommended (SMTP has problems if the
address are not correct). I also have used the Mailto:
but am having problems passing the body with formating
urlencode puts + all over.
here is the code attempting the outlook model:

Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "t_***@email.msn.com"
objMail.cc = "" 'Enter an address here To include
a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body

strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
i get this error:

Cannot create ActiveX component.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Exception: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("Outlook.Application")
Line 183: objMail = objOutlk.createitem(olMailItem)
Line 184: objMail.To = "t_***@email.msn.com"

is there something special i have to do to get outlook to
work - set impersonate = true in the web.config?

thanks for any help!

Jul 21 '05 #4

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

Similar topics

3
by: Sam | last post by:
My db looks after the hiring and lending of equipment, the form which books out equipment hired prints a signout sheet and automatically inserts an appointment into outlook advising the operator on...
2
by: sfriedman | last post by:
I was able to successfully link my Outlook Contacts table to an Access Database and create an entry form. Unfortunately the Displayname field which is one of the key fields for how the contact is...
2
by: Eric Peterson | last post by:
I need to pop up the send email form from Outlook. I also need to populate the to field, but obviously the user will type the message and hit 'SEND'. How can I do this? I've been through...
2
by: Siv | last post by:
Hi, I have written an application which is used by sales staff when discussing products with their customers over the phone. It is a database application that holds detailed information about...
3
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model...
1
by: Mr T | last post by:
I know how to send email from Access and I know how to create a custom form in Outlook. but.... How do I put the email info from Access into the Outlook custom form ??? Dim MyDB As Database Dim...
5
by: xin.yadong | last post by:
Is there a way to create an New Outlook Email from an ASP.NET application? I can not use "mailto:", since it is only support a string less than 512. I have find a good way from link :...
3
by: mirkobonet | last post by:
The idea is creating a contact form using mailto so it work with the regular mail program. (the server doesn't support php or asp) I created the form and the function is function mailMe(form){...
23
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.