我正在開發應用程序,它發送電子郵件。我在Hotmail上創建了帳戶。 這是我的代碼:通過Hotmail發送郵件到Gmail gmail
try
{
using (var smtpClient = new SmtpClient())
{
var mailAddressTo = new MailAddress(emailType.EmailAddress);
var mailAddressFrom = new MailAddress("id");
using (var mailMessage = new MailMessage(mailAddressFrom, mailAddressTo))
{
smtpClient.Host = "smtp.live.com";
smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.Credentials = new NetworkCredential("[email protected]", "pass");
mailMessage.Subject = emailType.EmailSubject;
smtpClient.Send(mailMessage);
}
}
}
catch (Exception ex)
{}
但它給了我異常:
Mailbox unavailable. The server response was: 5.3.4 Requested action not taken; We noticed some unusual activity in your Hotmail account. To help protect you, we've temporarily blocked your account.
我不想使用Gmail,因爲它需要的電話號碼。我怎麼用hotmail做到這一點? 謝謝
提供的錯誤消息,顯然看起來就像你不能使用Hotmail – levelnis 2013-03-16 11:40:37
做到這一點我不明白爲什麼這個問題已被標記下來...我有同樣的問題,並幫我解決它。 – Roman 2015-08-03 00:04:44