From ShellExcute to Process.Start..

G

Guest

Hi EveryBody:

Two days ago I post a question about how can I use ShellExcute function in
sending e-mail file ?

I got to Helpfull replayment from Mr.Mattias and Mr.Herfried K. Wagner

which telling me that I can use System.Diagnostics.Process instaed of
ShellExcute Function ?

I read About that mant articals Until I come up with this code:

Dim myProcess As New Process
Dim toEmail As String = "(e-mail address removed)"
Dim subject As String = "This is a test Subject"
Dim body As String = "This is a test email message"
Dim message As String =
String.Format("mailto:{0}?subject={1}&body={2}", toEmail, subject, body)
myProcess.StartInfo.Verb = "Send"
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start(message)

But still this code will lanch the default e-mail sender which is in my case
OutLook.

So my questioj is, Can I any one help me and direct me in adjusting this
code and make it send e-mail with out depending on any program such as
Outlook ?

Any help or redirections will be completlly appreciated

regard's
 
H

Herfried K. Wagner [MVP]

Husam said:
So my questioj is, Can I any one help me and direct me in adjusting this
code and make it send e-mail with out depending on any program such as
Outlook ?

Use 'System.Web.Mail' in .NET 1.0/1.1 or 'System.Net.Mail' in .NET 2.0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top