How to authenticate the mail in ASP?

How to authenticate the mail in ASP?

You can use the below mentioned content to authenticate the mail in ASP.

1] Sub Authenticate()
First create the mail message
Dim mail As New MailMessage()

2] Set the addresses
mail.From = New MailAddress("me@mycompany.com")
mail.To.Add("you@yourcompany.com")

3] Set the content as placed below
mail.Subject = "This is an email"
mail.Body = "This is the body content of the email."

4] Now send the message -
'Dim smtp' As New SmtpClient("127.0.0.1")

5] Then to authenticate, user must set the username and password properties on the SmtpClient.
That is, smtp.Credentials = New NetworkCredential("username", "secret")
smtp.Send(mail)

Finally End Sub Authenticate.

Note that in step 2, you should replace the words "me and you@mycompany.com", with your name and yours company's name.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do i disable directory listing from Plesk?

Disable Directory Listing Step 1:Login to Plesk Step 2:Goto Domains -> Domain Name -> Web...

How to create or edit the MX windows in plesk windows server

Login to your Plesk using the username and password associated with your domain. In right pane...

How to setup a access database in plesk?

Access database (mdb) in Plesk - How to setup a access database in plesk Upload the mdb file in...

How to access the MSSQL 2008 database using Remote Database Connectivity?

How to access the MSSQL database using Remote Database Connectivity? Follow the below to access...

How to redirect using Plesk ControlPanel?

Redirect Using Plesk Step 1:Login to plesk control panel. Step 2:Select Mail. Step 3:Select on...