View Single Post
  #2 (permalink)  
Old 02-21-2008, 05:56 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,321
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up How to send email in VB.NET 2005(From Windows Applications)

Hi sivakumar,

Welcome to Discussweb IT Community,

Sending a email using ASP.NET 2.0 and VB.NET is actually very simple.

First, you will need to import the System.Net.Mail namespace.

The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email.

Use the btnSubmit_Click event to do the work.

Code:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Try

Dim message As New MailMessage(ToAddress, From Address, Subject, Message)
Dim emailClient As New SmtpClient(your SMTP Server Address) \\ smtp.gmail.com
emailClient.Send(message)

Catch ex As Exception

End Try
End Sub
If you need more assistance post your code here...

Hope this helpful
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote