title: asp.net send mail in vb.net
body: <p>This is web config</p>
  
  <pre><code> &lt;appSettings&gt;
       &lt;add key="SmtpServer" value="gmail.com"/&gt;
       &lt;add key="SmtpUtilisateur" value="superman@gmail.com"/&gt;
       &lt;add key="SmtpPassword" value="12345678"/&gt; 
   &lt;/appSettings&gt;
  </code></pre>
  
  <p>This my vb method</p>
  
  <pre><code> Sub SendSimpleMail()
  
  
      Dim Message As New Mail.MailMessage
      Dim utilisateur As String
      Dim pass As String
      Dim server As String
  
      utilisateur = ConfigurationSettings.AppSettings("StmpUtilisateur")
      pass = ConfigurationSettings.AppSettings("SmtpPassword")
      server = ConfigurationSettings.AppSettings("SmtpServer")
  
      Message.From = "superman@gmail.com"
      Message.To = "superman@gmail.com"
      Message.Subject = "test"
      Message.Body = "salut je voulais savoir comment tu allais"
  
  
      Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
      Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", utilisateur)
      Message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtppassworld", pass)
      SmtpMail.SmtpServer = server
      Try
          SmtpMail.Send(Message)
      Catch ex As Exception
          Label1.Text = ex.Message
      End Try
  
  
  End Sub
  </code></pre>
  
  <p>I get an error like the "transport fail in connection to server"</p>
  
  <p>I don't know why this is not work well...</p>
  
  <p>Thank's for helping me!</p>
  
  <p>This in vb.net</p>