when ever i execute my project this kind of error occoured
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebExceptio n: Unable to connect to the remote server ---> System.Net.Sockets.SocketExceptio n: No connection could be made because the target machine actively refused it 12 7.0.0.1:25
Have you verified that your local machine can process an SMTP request? It sounds like that you have blocked SMTP on your local machine (port 25) or you do not have the correct credentials for your SMTP server locally.
Christopher Reed, MCT, MCSD, MCPD, Microsoft Specialist, MTA, MCTS
"The oxen are slow, but the earth is patient."
Member
7 Points
24 Posts
Unable to connect to the remote server
Jan 04, 2012 01:38 AM|Anbu Arunmozhi|LINK
Participant
871 Points
219 Posts
Re: Unable to connect to the remote server
Jan 04, 2012 01:43 AM|setahamid|LINK
try following it may help you to resolve your issue
http://stackoverflow.com/questions/5430097/problem-with-sending-email
http://www.codeproject.com/Questions/202693/System-Net-Mail-SmtpException-Failure-sending-mail
http://www.codeproject.com/Questions/58761/No-connection-could-be-made-because-the-target-ma
Or
It can be due to firewall settings or antivirus solutions blocking traffic.
Hamid Seta
http://www.hamidseta.blogspot.com/
Remember to click “Mark as Answer” on the post, if it helps you.
Star
13150 Points
4052 Posts
Re: Unable to connect to the remote server
Jan 04, 2012 01:47 AM|Careed|LINK
Have you verified that your local machine can process an SMTP request? It sounds like that you have blocked SMTP on your local machine (port 25) or you do not have the correct credentials for your SMTP server locally.
"The oxen are slow, but the earth is patient."
Contributor
2285 Points
912 Posts
Re: Unable to connect to the remote server
Jan 04, 2012 01:52 AM|Sum8|LINK
Do you have a SMTP server? If yes, are you able to ping it? Otherwise you need to test your code on the server having SMTP server installed.
Member
170 Points
77 Posts
Re: Unable to connect to the remote server
Jan 04, 2012 02:25 PM|ray9|LINK
1st verify that you smtp mail server settings are ok,
2nd, check why your application is sending email on its start ? is that necessary ?
Member
7 Points
24 Posts
Re: Unable to connect to the remote server
Jan 05, 2012 01:38 AM|Anbu Arunmozhi|LINK
yes , in my local system no smtp server .
do u know how to install smtp server in windows 7 .
that same code work in windows xp but not work in windows 7
Star
13150 Points
4052 Posts
Re: Unable to connect to the remote server
Jan 05, 2012 02:07 AM|Careed|LINK
Microsoft removed the SMTP server from IIS in Windows 7. You can use any freeware SMTP server.
Look here for info on freeware SMTP: http://www.softstack.com/freesmtp.html
You probably should run this as a Windows service, as it will need to be running continuously to ensure its availability.
"The oxen are slow, but the earth is patient."
Member
90 Points
75 Posts
Re: Unable to connect to the remote server
Jan 05, 2012 04:00 PM|zaco09|LINK
consider using this free mail server:
http://www.hmailserver.com/index.php?page=welcome