Hi,
I have a web application that's sending mail through a SMTP server lets say 'server1'. Now I wanted to change the smtp server to another server say 'server2'. So when I do that it throws a System.Runtime.InteropServices.COM Exception saying 'The server rejected one or more recipient addresses'. When I change back the servername to 'server1' it works fine.
Neither server1 nor server2 is the server hosting the web application.
Here is the code:
System.Web.Mail.SmtpMail.SmtpServer="smtp.server1. com";
System.Web.Mail.SmtpMail.Send("
[email protected] ", "
[email protected]", "subject", "body");
In the above code if I replace 'smtp.server1.com' with lets say 'smtp.server2.com' and '
[email protected]' with '
[email protected]' it gives me an error.
Now I know that both smtp.server1.com and smtp.server2.com are reachable since I can send mail through these accounts configured in MS Outlook.
Can anyone please help? Also do I need to pass my username and password to logon to these servers to send mail through them? If yes then how do I do that? and how come the first server doesnt require this sort of authentication?
Thank you in advance.
qadeer