using var client = new SmtpClient();
try
{
client.Connect("smtp.qq.com", 587, false);
client.Authenticate("[email protected]", "XXXXXXX");
client.Send(message);
}
catch
{
client.Disconnect(true);
return -1;
}
如果目標郵箱地址有誤的話,也會正常發送,不發生例外。請問大家如何才能精確判斷郵件成功發送到對方的郵箱。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/269130.html
標籤:C#
