0
我在使用gmailD發送電子郵件時收到以下錯誤消息。使用GmailD發送電子郵件時出錯
SMTP服務器需要安全連接或客戶端未通過身份驗證。服務器響應是:5.5.1需要身份驗證。
MailMessage objMailMessage = new MailMessage();
objMailMessage.From = new MailAddress("[email protected]");
objMailMessage.To.Add(new MailAddress("[email protected]"));
objMailMessage.Subject = "Test";
objMailMessage.Body = "Test Test";
objMailMessage.IsBodyHtml = true;
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = "smtp.gmail.com";
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new System.Net.NetworkCredential("[email protected]", "password");
smtpClient.Send(objMailMessage);
你確定你的電子郵件地址和密碼正確設置? – 2012-04-11 05:51:45