views:

38

answers:

1

I want to use gmail-mail servers, I have registrated to google app and I have my company mails in gmail.

iam getting this error: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com'

WHy is this not working, Iam using the email and password

A: 
                 MailMessage message = new MailMessage(from, to, subject, body);
            message.IsBodyHtml = true;
            message.Priority = MailPriority.High;
            SmtpClient mailClient = new SmtpClient();
            mailClient.Credentials = new System.Net.NetworkCredential
                    ("[email protected]", "__________");
            mailClient.Port = 587;
            mailClient.Host = "smtp.gmail.com";
            mailClient.EnableSsl = true;
            mailClient.Send(message);
            message.Dispose();
Troj