主题:[讨论]用C#发送邮件问什么会出现这个问题
我代码编译没有问题但是再发送后会出现这个 “发送到demonsine@163.com主题为成功注册的信息无法送达,因为到邮件服务器的连接中断。”
并且邮箱并不能收到请问是什么原因
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string to = "demonsine@163.com";
string from = "de_mon@foxmail.com";
string body = @"你已经成功注册APEX校园博客.";
string subject="成功注册";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient("smtp.foxmail.com",25);
client.Credentials = new System.Net.NetworkCredential("我的用户名", "我的密码");
client.Send(message);
}
}
我很急 如果解决全分送上
并且邮箱并不能收到请问是什么原因
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string to = "demonsine@163.com";
string from = "de_mon@foxmail.com";
string body = @"你已经成功注册APEX校园博客.";
string subject="成功注册";
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient("smtp.foxmail.com",25);
client.Credentials = new System.Net.NetworkCredential("我的用户名", "我的密码");
client.Send(message);
}
}
我很急 如果解决全分送上