Form Mail .net

In web.config File
 
  <system.net>
    <mailSettings>
      <smtp>
        <network host="domain_name" password="EmailPassword" userName="mail@domain_name"/>
      </smtp>
    </mailSettings>
  </system.net>
 
 
On button click
 
 
Imports System.net.Mail
 
Dim mail As New MailMessage()
        mail.From = New MailAddress("mail@domain_name ")
        mail.[To].Add(New MailAddress("sandra@gmail.com"))
        mail.CC.Add(New MailAddress("lela@gmail.com"))
                mail.Subject = subject
        mail.Body = body
        mail.IsBodyHtml = True
       Dim authorise As New System.Net.NetworkCredential("mail@domain_name ", "EmailPassword")
        Dim client As New SmtpClient("mail.domain_name ", 25)
        client.EnableSsl = False
        client.UseDefaultCredentials = False
        client.Credentials = authorise
        'Try
        client.Send(mail)

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Form Mail php for Windows Server

This is php form mail script for Windows server which mail ids configure with your own Hosting...

PHP Form Mail For Linux Server using SMTP authentication

Send Email from a PHP Script Using SMTP AuthenticationTo connect to an outgoing SMTP server from...

ZOHO Form Mail

This is PHP form mail script for Linux server where mail ids are configured with ZOHO Mail....