Hello Friends
last days i was searching the internet and i found that we can use gmail account credential as a smtp server.
Here is the code for the how use gmail credential for sending a mail form the asp .net.
Create
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim loginInfo As New NetworkCredential(gmailaccount, gmailpassword)
Dim msg As New MailMessage()
msg.From = New MailAddress(gmailaccount)
msg.To.Add(New MailAddress(”testing@yahoo.com”))
msg.Subject = “test gmail account test”
msg.Body = “hi arjun. nice code you gave to me thanks for the knowledge sharing.”
msg.IsBodyHtml = True
Dim client As New SmtpClient(”smtp.gmail.com”)
client.EnableSsl = True
client.UseDefaultCredentials = False
client.Credentials = loginInfo
client.Send(msg)
End Sub
Please use this code and tell me it will works for your or not.
Enjoy the code.
Tags: send E-mail from asp .net using Gmail account credentia
Hello ! I am Arjun Jadeja a Software Engineer by Profession. You can contribute and I will distribute your ideas through this site. Thanks and Enjoy
Leave a reply