我碰到情況如下:1.通過SSL加密發送2.通過ssl.alibaba-inc.com服務器,端口465發送郵件提示“操作已超時”3.代碼沒變,發送126,gmail不管是普通郵件還是日程都可以發送成功!Code: string hostServer = "ssl.alibaba-inc.com"; string email = myemail; string authName = name; string password = mypassword; int port = 465; MailMessage msg = new MailMessage(email, EmailAddress.Text.Trim()); msg.Body = "hello!"; msg.Subject = "hello"; SmtpClient smtp = new SmtpClient(); smtp.Credentials = new NetworkCredential(email, password); smtp.Port = 465; smtp.Host = "ssl.alibaba-inc.com"; smtp.EnableSsl = true; smtp.Timeout = 50000; try { smtp.Send(msg); } catch (SmtpException ex) { ex.ToString(); }
- 2 回答
- 0 關注
- 1763 瀏覽
添加回答
舉報
0/150
提交
取消