About the author

Imran Imran
Like Development in DotNet.

E-mail me Send mail
Search Entire Web

Recent Articles

 
1: Master Pages
Category: ASP.Net
Added: 1/31/2008

 
2: Caching with ASP.NET
Category: ASP.Net
Added: 1/31/2008

 
3: Free Microsoft Press E-Book Offer!
Category: ASP.Net
Added: 1/30/2008

 
4: Timer Control in Asp.Net
Category: ASP.Net
Added: 1/29/2008

 
5: Checkbox selection with ajax
Category: ASP.Net
Added: 1/29/2008

 
6: UrlRewriter with asp.net
Category: ASP.Net
Added: 1/19/2008

 
7: Auto complete textbox with Ajax
Category: ASP.Net
Added: 1/15/2008

 
8: Upload file with Asp.Net
Category: ASP.Net
Added: 1/15/2008

 
9: User Rating Technique
Category: ASP.Net
Added: 1/8/2008

 
10: Encryption And Decryption Library
Category: ASP.Net
Added: 1/5/2008

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





Powered by DotNetClassic.com