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.

Was this answer helpful?

 Print this Article

Also Read

How can I access Webmail from outside of Plesk?

Access Webmail - You can access the Webmail from outside of Plesk Control panel by typing...

How to upload files in windows server

You can upload the files using either FTP softwares or by File Manager in cpanel. Option 1: For...

How to reset password for email accounts?

Step 1: Login to your plesk control panel. Step 2: Click Mail Accounts. Step 3: Click the...

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 create Database and user to the Database in Plesk?

Create Database You can create database using the following steps. Step 1: Login to the Plesk....