public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
send("chenghai", "项目通知发送成功!", "有关OA详细内容查看");
}
public void send(string to, string subject, string content)
{
try
{
string fromEmail = "项目管理系统<public@xx.net.cn>";
string toEmail = to + "@163.com";
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(System.Configuration.ConfigurationManager.AppSettings["webmail"].ToString());
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("public", "public");
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
}
catch
{
}
邮件发送不了 ,catch :邮件发送失败,-------{"无法连接到远程服务器"}
如果你们又相关代码粘出来 给我啊 ,
30秒到达战场