Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 23, 2012 03:01 PM by arun banik
Dec 22, 2012 02:56 PM|LINK
I have troubles in code behind, I need to send an email after clicking a button. But my host is localhost now, and I am getting an error...
I will type here some parts of codes, and if you'll see what is wrong, please help me.
This is written in my button click event:
System.Net.Mail.SmtpClient _smtpClient = new System.Net.Mail.SmtpClient();
and this one in my .config file:
<network host="127.0.0.1" port="25" />
The error is that the target computer's reject the request
Dec 22, 2012 04:40 PM|LINK
You need to have installed IIS and SMTP server on your PC
Dec 23, 2012 03:01 PM|LINK
Write this code in web.config file
Also check this link for sending emails using "SmtpClient()"