我有一個問題,當我上傳一個應用程序到Web。我想發送郵件給幾個用戶,但它不起作用,但是當我發送本地主機正常工作。不要發送郵件asp.net應用程序託管只在localhost
這裏是我的代碼來發送郵件
System.Net.Mail.MailMessage correo = new System.Net.Mail.MailMessage();
correo.To.Add(mail_usuario);
correo.Body = cuerpomensaje;
correo.BodyEncoding = System.Text.Encoding.UTF8;
correo.Priority = System.Net.Mail.MailPriority.Normal;
correo.IsBodyHtml = true;//false tested too.
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
smtp.Host = "mail.cscdecision.com";
smtp.Credentials = new System.Net.NetworkCredential("[email protected]", "IDPass");
//smtp.Credentials = new System.Net.NetworkCredential(sMailEnvioEmpresaServicio , sClaveEmpresaServicio);
smtp.EnableSsl = true;
smtp.SendAsync(correo, null);
//smtp.Send(correo);
的錯誤是:「無法發送給所有收件人」
爲什麼在本地主機的作品,並在主機沒有?
Error: System.Net.Mail.SmtpFailedRecipientsException: Unable to send to all recipients.
System.Net.Mail.SmtpFailedRecipientException: The mailbox is unavailable.
The server response was: 5.7.1 <[email protected]> Access to <[email protected]> not allowed
您是否收到錯誤?這個應用程序在哪裏部署? – HTX9
錯誤是「無法發送配方」。主持人我不知道,但程序的早期版本正常工作。 – Alex
當我使用smtp.Send(correo)給我那個錯誤,但與smtp.SendAsync(相關)沒有發生 – Alex