I am trying to send an email using visual studio 2015 on a windows pc. i amusing a outlook email adress to send the emails please can somebody help me get the code rigth. i have tried many methods but they either timeout or say that they caanot send failure to send email. Please help
SmtpClient cv = new SmtpClient("smtp.live.com", 25);
cv.EnableSsl = true;
cv.Credentials = new NetworkCredential("[email protected]", "password");
try
{
cv.Send("[email protected]", "[email protected]", "", "Hello");
MessageBox.Show("Done");
}
catch(Exception w)
{
MessageBox.Show("Not send" + w.InnerException);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…