Groups | Blog | Home
all groups > dotnet general > april 2006 >

dotnet general : Email and .NET



Charles A. Lackman
4/5/2006 5:48:35 PM
Hello,

I am trying to format an email and have a .net application open up Outlook
or Outlook Express so that the user can simply click Send and have the
formatted email send from their email account. I am currently doing this
the following way:

Dim sParams As String
Dim TheTo, TheSubject, TheBody As String
TheTo = txtEmail.Text
TheSubject = ""
TheBody = ""
sParams = "mailto:" & TheTo
sParams = sParams & "?subject=" & TheSubject
sParams = sParams & "&body=" & TheBody
System.Diagnostics.Process.Start(sParams)

The problem this is that it creates a new instance of Outlook every time the
event is fired to create the email. All I want is for a new email to appear
and add the data that I want. After about 6 or 7 emails are created this
way, Outlook freezes up and stops working.

Any suggestions will be greatly appreciated,
This is vb .net.

Chuck

Charles A. Lackman
4/6/2006 1:38:05 AM
Hello,

The application is being made to work with only Outlook or Outlook Express.

Thanks,

Chuck

[quoted text, click to view]
Chuck,

[quoted text, click to view]

If you have the possibility, try to send the email directly out of your
application (instead of using any other Email Client)... Just thing
about, if someone uses Outlook Express or Mozilla Thundbird or any other
Mail Client, then your solutions won't work or is at least partly
dependent on the third party client.

Check out System.Web.Mail (on .NET 1.1) or System.Net.Mail (on .NET 2.0).

hth
Markus

Kevin Spencer
4/6/2006 7:17:05 AM
Outlook is an SMTP client, when it comes to sending emails. As Markus told
you, it is not necessary to use Outlook to send an email. Your application
can send it all by itself, using the System.Net.Mail namespace and the
SmtpClient class. See:

http://msdn2.microsoft.com/en-us/library/system.net.mail.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.


[quoted text, click to view]

Markus
4/6/2006 8:47:25 AM
Chuck,

[quoted text, click to view]

If you have the possibility, try to send the email directly out of your
application (instead of using any other Email Client)... Just thing
about, if someone uses Outlook Express or Mozilla Thundbird or any other
Mail Client, then your solutions won't work or is at least partly
dependent on the third party client.

Check out System.Web.Mail (on .NET 1.1) or System.Net.Mail (on .NET 2.0).

hth
Charles A. Lackman
4/7/2006 9:11:55 AM
Hello,

Everything is working great.

Thanks for the Help,

Chuck


[quoted text, click to view]
Outlook is an SMTP client, when it comes to sending emails. As Markus told
you, it is not necessary to use Outlook to send an email. Your application
can send it all by itself, using the System.Net.Mail namespace and the
SmtpClient class. See:

http://msdn2.microsoft.com/en-us/library/system.net.mail.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.


[quoted text, click to view]


AddThis Social Bookmark Button