Click here to Skip to main content
15,885,899 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using below code to generate mail through C # code
C#
SmtpClient smtp = new SmtpClient("smtp.live.com", 587);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("XYZ@live.com", "********");
MailMessage mail = new MailMessage("XYZ@live.com", "ABC@live.com", "Registered Query", ("Dear Sir" + "\r\n " + "\r\n " + TextBox4.Text + "\r\n " + "\r\n " + TextBox1.Text + "\r\n" + TextBox3.Text + "\r\n" + TextBox2.Text));
smtp.Send(mail);
Response.Redirect("Submitbtn.aspx");

It was working properly offline when i running on my local computer,
But I uploading it on server after publishing website it is not working kindly help……………………
Posted
Updated 22-Nov-14 6:17am
v2
Comments
DamithSL 22-Nov-14 12:22pm    
may be firewall on web server blocked this port, comment the redirection and try display the error message, then you can find solution for the error.

1 solution

Try to configure certificates on server
I had the same problem on linux server, and after i wrote this in terminal:
certmgr -ssl smtps://smtp.gmail.com:465
mozroots --import --ask-remove
all worked fine
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900