Unable to test sending email from .NET code in Windows Vista Business.
I am writing code which I will migrate to an SSIS Package once it its proven. The code is to send
I am facing this issue last 6hr and I am new on that so I am trying to solve this issue in following way
1) I opened command prompt (e.g. Ctrl + R type cmd and enter).
2) And check to SMTP server ping and check response.
3) If it’s gets response then it’s ok and to move next step 4 other wise smtp name is wrong.
4) Then I check by telnet smtp port (e.g. 25 ) is open or not.
5) Using this cmd we check the SMTP response.
6) telnet "yoursmtpname" "portno” (e.g. telnet smtp.gmail.com 25)
7) If telnet is not working, please install or add from control panel in add new features.
8) If it’s working then it’s pass result like.
9) 220 mx.google.com ESMTP .
Using above steps we can find out smtp connection is ready or not to sending mail.
upgrade to .NET 4.0 and apply all security updates
Restart IIS. I know this sounds silly, to do a restart for everything. (and sorry to bump up an old thread). But sometimes restarting IIS works magic. I faced the exact same issue and restarting solved it.
Might have happened cause temporarily the name 'localhost' couldn't be resolved. I;m just posting here so that someone who faces it now will probably try this quick fix before attempting to investigate further. Hope it helps
If you are using localhost (Use Localhost) in IIS 7, then change it to IP address of the machine instead of localhost or 127.0.0.1
Also follow below link to update your mail server relay accordingly:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc@xyz.com
Vista and Windows 7 does not have any SMTP server, this facility has been removed since Windows XP, so you need to setup your SMTP server explicitly, several tools are available in market for that, you can check that out. Also once you configure the SMTP, remember to check the server name which you would be using to send the e-mail.
If you've specified an IP address in the SMTP Service settings then make sure you're specifying that IP address of the machine within IIS7 and not putting localhost
.
IIS7 makes it easy to select 'localhost' but that will lead to this error if the IP for instance is 10.0.0.1