Loading...

Knowledge Base

Send an email from .NET

As an Arvixe customer and a our forum user, janwillemb was kind enough to provide everyone with this piece of code to send mail, using SMTP Authentication (the only way to send emails out from our servers in order to reduce spam). Thank you!

To send an email from .NET, use this code:

      Dim msg As New MailMessage("[email protected]", "<emailaddress in your domain>")
      msg.Subject = "Subject here"
      msg.Body = "Body here"

      Dim client As New SmtpClient("localhost")
      client.Credentials = New Net.NetworkCredential("<email address in your domain>", "<password of this emailaccount>")
      client.Send(msg)

Loading...