Send Email With Asp.Net
by
Imran
05/January/2008
|
 |
Here is Code to Send Email with Asp.Net 2.0 Public Sub Mail(ByVal frome As String, ByVal toe As String, _ ByVal subject As String, ByVal message As String)
Try Dim mm As New MailMessage(frome, toe)
mm.Subject = subject
mm.Body = message
mm.IsBodyHtml = True Dim smtp As New SmtpClient
smtp.Host = "localhost"
smtp.Port = 25 smtp.Credentials = New NetworkCredential("username", password)
smtp.Send(mm)
Catch smtpEx As SmtpException
Catch generalEx As Exception
End Try
End Sub |
|
|