Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.. M a junoir developer..!
i am using following settings for sending email using my yahoo email a/c.. but I am getting time out error when I send mail..
C#
SmtpClient emailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
emailClient.EnableSsl = true;
emailClient.Credentials = ("xyz@yahoo.com","*******");
emailClient.UseDefaultCredentials = false;
mail.To.Add("abc@yahoo.com");
mail.Body =Message_Body.Text;
mail.Subject = Email_Subject.Text;
MailAddress address = new MailAddress("xyz@yahoo.com");
mail.From = address;
emailClient.Send(mail);

Pls guide me thanx..
Posted
Updated 6-Jun-13 3:09am
v2
Comments
bbirajdar 6-Jun-13 8:57am    
Oh... Thats sad
Prasad Khandekar 6-Jun-13 9:08am    
Hello,

As per MS documentation(http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl.aspx) SSL SMTP over 465 is not supported. try using Security Library from http://www.mentalis.org.

Regards,

Hello,

As per MS documentation SSL SMTP over port 465 is not supported. try using Security Library from Mentalis.org.
here is an another blog post related to Explicit SSL support by SmtpClient..


Regards,
 
Share this answer
 
This Works for me:


MailMessage msg = new MailMessage();
msg.From = new MailAddress("developers@gmail.com");
msg.To.Add(txtemail.Text);
msg.Subject = "Confirm Registration";
msg.Body = "Welcome To My Site";

SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 25;
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = true;
smtp.Credentials = new NetworkCredential("developers@gmail.com", "password");
smtp.Send(msg);
 
Share this answer
 
v2

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