title: VB.net sendmail smtp error
body: <p>I'm using the following code to send an email from my vb.net web application. </p>
  
  <pre><code>Public Function SendMail(ByVal strTo As String, ByVal strFrom As String, _
                              ByVal strSubject As String, ByVal strBody As String) As String
          Try
  
              Dim SmtpServer As New SmtpClient()
              Dim mail As New MailMessage()
              SmtpServer.Credentials = New _
              Net.NetworkCredential("ns1.jasmine.arvixe.com", "&lt;password&gt;")
              SmtpServer.Port = 587
              SmtpServer.Host = "mail.&lt;mydomain&gt;.com"
              mail = New MailMessage()
              mail.From = New MailAddress(strFrom)
              mail.To.Add(strTo)
              mail.Subject = strSubject
              mail.IsBodyHtml = True
              mail.Body = strBody
              SmtpServer.Send(mail)
              Return True
          Catch ex As Exception
              Return False
          End Try
      End Function
  </code></pre>
  
  <p>It works fine when I use my personal live.co.uk email address as the strFrom value, or even a made-up email address. But when I use a different one (contact@mydomain.com), which is perfectly valid and working, I get the following error: </p>
  
  <p>"The SMTP server requires a secure connection or the client was not authenticated. The server response was: SMTP authentication is required."</p>
  
  <p>Why does this happen? </p>