title: Fail Sending Email Unable To Connect the Remote Server
body: <p>im facing error when sending email. here is the error </p>
  
  <p><img src="https://i.stack.imgur.com/UvoVn.jpg" alt="Error Email Sending Failure"></p>
  
  <p>what is the actual error for this exception because i newbie in in this, by the way here is my code line:</p>
  
  <pre><code> Try
                  Dim SmtpServer As New SmtpClient()
                  Dim mail As New MailMessage()
  
                  SmtpServer.Credentials = New  _
                  Net.NetworkCredential("test@gmail.com", "passwordexample")
                  SmtpServer.EnableSsl = True
                  SmtpServer.Port = 587
                  SmtpServer.Host = "smtp.gmail.com"
  
                  mail = New MailMessage()
                  mail.From = New MailAddress("test@gmail.com")
                  mail.To.Add("examplemail@gmail.com")
                  mail.Subject = "Change Request Submitted"
                  mail.Body = "Dear User, " &amp; Environment.NewLine &amp; Environment.NewLine &amp; Environment.NewLine &amp; Environment.NewLine &amp; "One Notification have been submitted," &amp; Environment.NewLine &amp; "Please check the change request on the intranet application"
  
  //ad this line the error SmtpServer.Send(mail)
                  SmtpServer.EnableSsl = True
                  MsgBox("Notification emailed successfully")
              Catch ex As Exception
                  MsgBox(ex.ToString)
              End Try
  </code></pre>