We recently moved our site to a server we manage to save money. Since that point our contact page has not been working. Is there something we need to turn on to get the SmtpMail.Send function to work? The code was working on the other server we were using
so I don't think it is an error with the code.
For sending mail with Smtp.Mail, besides codes you should make sure the web.config configuration is correct.
And you need make sure the IIS configuration is correct.
You encountered the error in the publish server, so I think the error attributes to the incorrect configuration of IIS. Check if your SMTP virtual server is on the right work in IIS.
The different configuration of IIS can always bring on the code works in one server but not works in another server.
Hope it helps.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Marked as answer by petewill on Feb 04, 2008 03:11 PM
I made two changes and it is now working. First I added 127.0.0.1 and the ip address of the computer to the "Relay Restrictions" in the Default SMTP Virtual Server Properties in IIS.
I also had to change the ip address in the web.config file to the computer's ip address. I don't know if both of the changes were necessary or just the last one but everything is working now so I am happy.
petewill
Member
2 Points
8 Posts
Smtp.Mail.send Not Working
Feb 01, 2008 10:32 PM|LINK
We recently moved our site to a server we manage to save money. Since that point our contact page has not been working. Is there something we need to turn on to get the SmtpMail.Send function to work? The code was working on the other server we were using so I don't think it is an error with the code.
Thanks!
Pete
uncleb
Star
9644 Points
1864 Posts
Re: Smtp.Mail.send Not Working
Feb 02, 2008 12:48 AM|LINK
what error are you getting
is the smtp server still the same as old site ?
All that wander, are not lost...
What were we talkin bout
dinesh_sp
Contributor
2272 Points
413 Posts
Re: Smtp.Mail.send Not Working
Feb 02, 2008 01:04 AM|LINK
Hi pete, I think exchange settings would be different, try this if so
<system.net>
<mailSettings>
<smtp>
<network host="exchange address" usernm="" pwd=""/>
</smtp>
</mailSettings>
</system.net>
Vince Xu - M...
All-Star
80367 Points
6801 Posts
Re: Smtp.Mail.send Not Working
Feb 04, 2008 06:56 AM|LINK
Hi,
For sending mail with Smtp.Mail, besides codes you should make sure the web.config configuration is correct.
And you need make sure the IIS configuration is correct.
You encountered the error in the publish server, so I think the error attributes to the incorrect configuration of IIS. Check if your SMTP virtual server is on the right work in IIS.
The different configuration of IIS can always bring on the code works in one server but not works in another server.
Hope it helps.
usmanbhatti5...
Member
562 Points
117 Posts
Re: Smtp.Mail.send Not Working
Feb 04, 2008 07:10 AM|LINK
Check you smtp server settings
Please remember to click "Mark as Answer" on this post if it helped you.
www.usman-bhatti.blogspot.com
petewill
Member
2 Points
8 Posts
Re: Smtp.Mail.send Not Working
Feb 04, 2008 03:16 PM|LINK
Thanks for the Help Vince!
I made two changes and it is now working. First I added 127.0.0.1 and the ip address of the computer to the "Relay Restrictions" in the Default SMTP Virtual Server Properties in IIS.
I also had to change the ip address in the web.config file to the computer's ip address. I don't know if both of the changes were necessary or just the last one but everything is working now so I am happy.
Thanks again!