我碰到情况如下: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 关注
- 1731 浏览
添加回答
举报
0/150
提交
取消