/ Published in: ASP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Imports System.Net.Mail Protected Sub Button1_Click (ByVal sender As Object, ByVal e As EventArgs) Dim mail As MailMessage = New MailMessage() mail.Subject = "Email using Gmail" String Body = "Hi, this mail is to test sending mail"+ "using Gmail in ASP.NET" mail.Body = Body mail.IsBodyHtml = True Dim smtp As SmtpClient = New SmtpClient() smtp.Host = "smtp.gmail.com" //Or Your SMTP Server Address smtp.Credentials = New System.Net.NetworkCredential smtp.EnableSsl = True smtp.Send(mail) End Sub
URL: http://csharpdotnetfreak.blogspot.com/2009/08/send-email-using-gmail-in-aspnet.html