View Single Post
  #4 (permalink)  
Old November 20th, 2008, 04:25 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Did you look at the links I posted? You'll find example code in them:

Dim message As MailMessage = new MailMessage(
               "jane@contoso.com",
               "ben@contoso.com",
               "Quarterly data report.",
               "Plain text here.")
' optionally, set properties on message here:

' message.Body = "Plain Text Boxy" ' not necessary as it has been set in the constructor
' message.To.Add(other recipients go here)
' message.IsBodyHtml = False

Dim mySmtpClient As New System.Net.Mail.SmtpClient
mySmtpClient.Send(message)

This creates a new message, sets To, Fro, Subject and Body in the constructor and uses the SmtpClient to send it.

Hope this helps,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.