title: SMTPClient class error
body: <p>I´m  trying to send an email through gmail using this code:</p>
  
  <pre><code>MailMessage msg = new MailMessage();
              msg.From = new MailAddress("admin@XXXXXX.com");
              msg.To.Add(destinos);
              msg.Subject = "XXXX";
              msg.Body = "XXXX"
              //msg.Attachments.Add(new Attachment(archivo + ".pdf"));
              //msg.Attachments.Add(new Attachment(archivo + ".xml"));
              SmtpClient client = new SmtpClient("smtp.google.com", 587);//587 465 
              client.EnableSsl = true;
              client.DeliveryMethod = SmtpDeliveryMethod.Network;
              client.Credentials = new System.Net.NetworkCredential("admin@XXXX.com", pass);
  
                  client.Send(msg);
  </code></pre>
  
  <p>However it fails, giving this exception:</p>
  
  <pre><code>16/07/2012 03:45 p.m. ERROR: Error al enviar correo. Data: System.Collections.ListDictionaryInternal System.Net.WebException: No se puede resolver el nombre remoto: 'smtp.google.com'
     en System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress&amp; address, Socket&amp; abortSocket, Socket&amp; abortSocket6, Int32 timeout)
     en System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
     en System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
     en System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
     en System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
     en System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
     en System.Net.Mail.SmtpClient.GetConnection()
     en System.Net.Mail.SmtpClient.Send(MailMessage message) Exception actual: Void Send(System.Net.Mail.MailMessage)
  </code></pre>
  
  <p>The exception is in spanish, I don't really like that either but it says something like:</p>
  
  <pre><code>There was an error when sending the mail, Couldn't resolve host smtp.google.com
  </code></pre>
  
  <p>I have checked the current google parameters and they look good for this code.</p>