An existing connection was forcibly closed by the remote host
Posted
by Alexander
on Stack Overflow
See other posts from Stack Overflow
or by Alexander
Published on 2010-04-04T21:35:05Z
Indexed on
2010/04/04
21:43 UTC
Read the original article
Hit count: 203
I am about to give up debugging SMTP servers to send email... My code is the following
private void SendMail()
{
SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
mailClient.EnableSsl = true;
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "i wish it would work";
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
message.From = fromAddress;
mailClient.Send(message);
}
© Stack Overflow or respective owner