Friday, June 13, 2008

Email sending code in .Net

If you want to send email through .net then you can use System.web.mail package. In this package, you will find MailMessage class. Create on object for MailMessage class and fill object variables. After this use Send function.

Here is the example:-

Firstly, You import
Imports System.Web.Mail

Then Write Code

Dim msg As New Mail.MailMessage
msg.From = ”kamal.jindal@gharexpert.com“
msg.To = ”jindal82@gmail.com“
msg.BodyFormat = MailFormat.Html
msg.Body = “I am writing article of Sending Email with .NET page”
msg.Subject = “Sending Email with .NET page”
SmtpMail.Send(msg)


Thanks

No comments: