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(“”)

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

smtp.Credentials = New NetworkCredential(“”, “Your Password”)

You have to replace the domain – 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 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. He runs his own blog - and maintains a video portal which publishes videos related to web hosting, windows, social media and other technology related matters- You can follow Anand on twitter - @visualanand

Leave a Reply

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