Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending emails with VB.net

Status
Not open for further replies.

Jacksparrow87

Technical User
Jun 29, 2008
93
GB
I have really struggled on a simple problem which is trying to send an email through my vb application, I have search the web inside out and even looked at a few examples but it just doesn’t make any sense to me. I’ve read about SMTP servers and MAPI but don’t really understand much, I did also download the MAPI ddl file however I don’t know what to do next. Ideally what I would like is just something simple, take the text from a few textboxes and show that text in the body of the text in the email (Im using Outlook but if its easier using something else then fine.)

Well anyway recently I got to the point where I was about to give up but I came across something, In my vb application I placed a link label, and under the tag of the link label I put the following text: mailto test@test.com (obviously for spam reasons I have not included my email address.)

The under the link label click event I put the following:

Code:
System.Diagnostics.Process.Start(LinkLabel1.Tag.ToString())

What this does is simple, it opens up outlook express and the mailto address is pasted in the ‘To address’, as this is the most easiest way I have come across trying to send an email would it be possible to take all the text from the textboxces and show the text in the main body of the email?

Please help me as I’ve been trying to resolve this problem for about a month now, I never knew trying to send an email would be so difficult.

Thanks and I await your reply.
 
Is it a requirement to automate the user's email application? Typically, you might send an email in the background without requiring the user to send it from their email client. Here's an example on MSDN (for some reason they seem to omit VB samples from the System.Net.Mail examples).

 
Yeh I would prefer if the user sends the email, as they can edit the email and at the same time if they dont want to send an email they can click on the X in the top right hand corner.

I had a look at the link, however is there anywhere where I could download a sample program?

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top