View Single Post
  #2 (permalink)  
Old 02-22-2008, 10:13 PM
Balasubramanian.S Balasubramanian.S is online now
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 182
Balasubramanian.S is on a distinguished road
Default Re: How to send email in VB.NET 2005(From Windows Applications)

Hi,

Use this code to send mail.

Dim myMessage As System.Web.Mail.MailMessage
Try
myMessage = New System.Web.Mail.MailMessage
With myMessage
.To = "abc@xyz.co.in"
.From = "abc@xyz.co.in"
.Subject = "Testing Mail "
.Body = "This is a testing mail without attachments"
.BodyFormat = System.Web.Mail.MailFormat.Html
End With
System.Web.Mail.SmtpMail.Send(myMessage)

Catch myexp As Exception
MsgBox(myexp.Message, MsgBoxStyle.Critical, Me.Text)
End Try
__________________
S.Balasubramanian
Nothing is impossible
Reply With Quote