gmail的smtp采用了ssl连接:
     Outgoing Mail (SMTP) Server - requires TLS: smtp.gmail.com (use authentication)
     Use Authentication: Yes
     Use STARTTLS: Yes (some clients call this SSL)
     Port: 465 or 587

知道了gmail的发信细节,用System.Net.Mail,就是下面这段代码就可以了
使用System.Net.Mail通过gmail发送电子邮件using System;
使用System.Net.Mail通过gmail发送电子邮件
using System.Collections.Generic;
使用System.Net.Mail通过gmail发送电子邮件
using System.Text;
使用System.Net.Mail通过gmail发送电子邮件
using System.Net;
使用System.Net.Mail通过gmail发送电子邮件
using System.Net.Mail;
使用System.Net.Mail通过gmail发送电子邮件
使用System.Net.Mail通过gmail发送电子邮件
namespace GMailSend

相关文章: