Click here to Skip to main content
13,351,971 members (83,860 online)
Click here to Skip to main content
Add your own
alternative version


35 bookmarked
Posted 6 Feb 2006

Sending Authenticated e-mail in ASP.NET 2.0

, 6 Feb 2006
Rate this:
Please Sign up or sign in to vote.
How to send authenticated e-mail from ASP.NET (login/password)

Login to an SMTP server and send an email

There are many articles on how to send authenticated email in ASP.NET 2.0, but here's how to send an email using a SMTP server that requires authentication.

(Imports System.Net)

Dim client As New SmtpClient("") 'your SMTP server
client.UseDefaultCredentials = False

'Your username and password to login
client.Credentials = New Net.NetworkCredential("username", "password") 
client.DeliveryMethod = SmtpDeliveryMethod.Network
Dim Mail As New MailMessage("", "", _
        "This is my subject", _
        "This is my pretty, yet boring and useless message")
Mail.IsBodyHtml = True

Catch ex As Exception
    Response.Write(ex.Message) 'Write error message
    Exit Sub
End Try



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Catalin Radoi
United States United States
I am a software programmer from Bucharest, Romania.
I am 24 years old and I am very pleased with my job at Elven Soft, a company specialized in custom software development and web design

You may also be interested in...

Comments and Discussions

Questionhow to mange SmtpPermission or security policy Pin
seedawi10-Sep-08 14:41
memberseedawi10-Sep-08 14:41 
Generalpls help Pin
wasif_Muhammad22-Feb-07 3:19
memberwasif_Muhammad22-Feb-07 3:19 
GeneralSending Authenticated e-mails in ASP.NET 2.0 by Using Pin
AmirK116-Jul-06 20:08
memberAmirK116-Jul-06 20:08 
GeneralRe: Sending Authenticated e-mails in ASP.NET 2.0 by Using Pin
svkoli1-Jan-07 16:21
membersvkoli1-Jan-07 16:21 
QuestionASP.Net 1.1 Pin
farajallah9814-Mar-06 0:54
memberfarajallah9814-Mar-06 0:54 
AnswerRe: ASP.Net 1.1 Pin
Catalin Radoi14-Mar-06 2:28
memberCatalin Radoi14-Mar-06 2:28 
GeneralExchange Server Pin
Azel Low6-Feb-06 21:41
memberAzel Low6-Feb-06 21:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 6 Feb 2006
Article Copyright 2006 by Catalin Radoi
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid