2-7-2020 21:56:53
Nếu bị lỗi không gửi được email :
Failure sending mail=== at SystemNetMailSmtpClientSend(MailMessage message) at jackpot2tilsSendMail(String to, String subject, String body, String smtpser, String smtpPassword) at
Thì chắc chắn là bạn đang bị cấm gửi đi từ port 443, chỉ cần đổi port là code CS có thể gửi được
public static void SendMail(string to, string subject, string body, string smtpser, string smtpPassword)
{
SystemNetMailSmtpClient client = new SystemNetMailSmtpClient("smtpgmailcom");
clientPort = 587;
clientCredentials = new SystemNetNetworkCredential(smtpser, smtpPassword);
clientEnableSsl = true;
SystemNetMailMailMessage msg = new SystemNetMailMailMessage(smtpser, to, subject, body);
msgIsBodyHtml = true;
clientSend(msg);
}
Port 587, sẽ gửi được, thử xem bạn hiền