'Unable to send to all recipients localhost asp.net
Trying to send email via ASP.NET (classic ASP on the server works fine) and getting the "Unable to send to all recipients." error. Mail server is setup on localhost, Windows 2003 server 64-bit.
Web Config is as follows:
<mailSettings>
<smtp from="[email protected]">
<network host="127.0.0.1" port="25" defaultCredentials="true" />
</smtp>
</mailSettings>
Code that generates:
MailMessage mm = new MailMessage();
mm.From = new MailAddress("[email protected]");
mm.To.Add(email);
mm.Bcc.Add("[email protected]");
mm.CC.Add("[email protected]");
mm.Subject = "Your ENGL" + course + "-" + section+ " RaiderWriter account";
mm.Body = sb.ToString();
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Send(mm);
Solution 1:[1]
If you have more than one invalid/non-existent email address in your recipients, this error message might happen on some email server, and on our email server the case applies for those email addresses are no longer valid because the employees left the company. Please let me know if you find any other possible cause.
Solution 2:[2]
Check if the sending mailbox is full - over the allocated quota.
Solution 3:[3]
that can be if: 1)the user or pass are wrong 2)not enable SSL 3)less secure app is not enable 4)you have not log in in server with this mail
Solution 4:[4]
In our case the reason was that the SMTP-Server refused messages sent by a machine with a specific IP-Address.
SMTP-Server was part of IIS and there was a list of IPs configured which were allowed to use this SMTP-Server. The client machine in question was not part of the list so we got "Unable to send to all recipients." (or "Senden an alle Empfänger nicht möglich." in german).
Sending from a "valid" client worked.
The error message from the SMTP-Server in this case was pretty misleading.
Solution 5:[5]
i struggle a lot and found that there were issue with my Application Pool. I set defaultAPPPool and my code worked.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | yangli.liy |
| Solution 2 | Sean |
| Solution 3 | Dayannex |
| Solution 4 | |
| Solution 5 | biegleux |
