Authenticate Emails in ASP.NET Using SMTP

Nowadays, you need to enable SMTP authentication for all emails send from your hosting account. It is easy to enable SMTP in case if you make use of e-mail clients such as Outlook. However, you should provide the required authentication code if you attempt to send an e-mail through ASP.NET web form.

ASP.NET 4.5 has simplified the process of SMTP authentication when compared to prior versions, which make use of CDO object.

(1) You need to create an object of smtpClient() and pass the required mail server as parameter

Dim smtp As New SmtpClient(“mail.abcd.com”)

(2) Pass your mail account username and password to NetworkCredential() object

smtp.Credentials = New NetworkCredential(“mails@abcd.com”, “Your Password”)

You have to replace the domain – abcd.com and Your Password with your correct credentials.

Your emails will now be authenticated.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , | Posted under ASP .NET 4.0 | RSS 2.0

Author Spotlight

Anand Narayanaswamy

Anand Narayanaswamy

Anand works as a freelance writer based in Trivandrum, India. Anand runs NetAns, which provides hosting for developers and small scale businesses. He also provides blog installation services.

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 6 = 14

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>