473,804 Members | 4,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("O utlook.Applicat ion")
objMail = objOutlk.create item(olMailItem )
objMail.To = "t_***@email.ms n.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.attach ments.add
("C:\MyAttachme ntFile.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.Exceptio n: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("O utlook.Applicat ion")
Line 183: objMail = objOutlk.create item(olMailItem )
Line 184: objMail.To = "t_***@email.ms n.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 5962
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("O utlook.Applicat ion")
objMail = objOutlk.create item(olMailItem )
objMail.To = "t_***@email.ms n.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.attach ments.add
("C:\MyAttachm entFile.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.Exceptio n: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("O utlook.Applicat ion")
Line 183: objMail = objOutlk.create item(olMailItem )
Line 184: objMail.To = "t_***@email.ms n.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("O utlook.Applicat ion")
objMail = objOutlk.create item(olMailItem )
objMail.To = "t_***@email.ms n.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.attach ments.add
("C:\MyAttach mentFile.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.Exceptio n: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject ("Outlook.Appli cation")Line 183: objMail = objOutlk.create item(olMailItem )
Line 184: objMail.To = "t_***@email.ms n.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*******@what ever.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("O utlook.Applicat ion")
objMail = objOutlk.create item(olMailItem )
objMail.To = "t_***@email.ms n.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.attach ments.add
("C:\MyAttachme ntFile.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.Exceptio n: Cannot create
ActiveX component.

Source Error:
Line 180: Const olMailItem = 0
Line 181: 'Create a new message
Line 182: objOutlk = CreateObject("O utlook.Applicat ion")
Line 183: objMail = objOutlk.create item(olMailItem )
Line 184: objMail.To = "t_***@email.ms n.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
7524
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 the due date that a particular hire is due. I have used microsoft's automated appointment code to do this, what I would also like the code to do is to email an appointment to the person hiring the gear. Knowing that you can email an...
2
2301
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 stored states that it is an expression and will not accept entry, nor will it automatically conjoin the first and last names as it would normally do if you entered it in an outlook form. Without this when you click on the entry in outlook instead...
2
6117
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 various examples, and they're all about automating email within vb, I only want to automate 1/2 the process. Thanks for help. Eric
2
14424
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 their products including pictures to assist the sales staff describe features to the customer. The next step in development of the app is to have a button when in a particular product screen that the seller can press which sends the customer an...
3
492
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 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
1
5961
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 MyRS As Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment
5
7218
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 : http://zones.advisor.com/doc/17330 , that thread show how to create a new appointment instead of email. but I have no idea about the format of a new email. Does any one know the format of a new outlook email i.e. Response.ContentType = "text/XXXXXX"...
3
7304
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){ Subject=document.testform.subj... message="First Name: "+document.testform.firstName.... '<br />' + "Last Name: "+document.testform.lastName.v... '<br />' + "Telephone: "+document.testform.phone.valu... '<br />' + "Company:...
23
5980
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.