C
Chuck Farah
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 = "(e-mail address removed)"
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 = "(e-mail address removed)"
is there something special i have to do to get outlook to
work - set impersonate = true in the web.config?
thanks for any help!
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 = "(e-mail address removed)"
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 = "(e-mail address removed)"
is there something special i have to do to get outlook to
work - set impersonate = true in the web.config?
thanks for any help!