Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / December 2005

Tip: Looking for answers? Try searching our database.

From ShellExcute to Process.Start..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Husam - 31 Dec 2005 12:39 GMT
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 = "husamal_ahmadi@yahoo.com"
       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
Ken Tucker [MVP] - 31 Dec 2005 12:51 GMT
Hi,

       You can use the mail message class

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwebmailmailmessageclasstopic.asp


http://dotnet.mvps.org/dotnet/faqs/?id=email&lang=en

Ken
------------------
> Hi EveryBody:
>
[quoted text clipped - 29 lines]
>
> regard's
Herfried K. Wagner [MVP] - 31 Dec 2005 13:23 GMT
"Husam" <Husam@discussions.microsoft.com> schrieb:
> 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.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.