MailMessage newmail=new MailMessage();
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1);
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","icmlc2006");
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","********");
newmail.To="[email protected]";
newmail.From="[email protected]";
newmail.Subject="hello";
newmail.BodyFormat=MailFormat.Html;
newmail.Body="这是我发送的第一个邮件程序";
SmtpMail.SmtpServer="smtp.126.com";
SmtpMail.Send(newmail);
我用上面的方法发送信件,可是返回的错误是:
The server rejected the sender address. The server response was: 553 You are not authorized to send mail, authentication is required
我不想用第3方控件实现,请问上面的问题怎么解决?
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1);
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","icmlc2006");
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","********");
newmail.To="[email protected]";
newmail.From="[email protected]";
newmail.Subject="hello";
newmail.BodyFormat=MailFormat.Html;
newmail.Body="这是我发送的第一个邮件程序";
SmtpMail.SmtpServer="smtp.126.com";
SmtpMail.Send(newmail);
我用上面的方法发送信件,可是返回的错误是:
The server rejected the sender address. The server response was: 553 You are not authorized to send mail, authentication is required
我不想用第3方控件实现,请问上面的问题怎么解决?
解决方案 »
- 为什么我一个项目里面的网页有的可以打开有的就打不开?
- asp.net数据查询的流量
- 未能找到存储过程 'dbo.aspnet_CheckSchemaVersion'。
- 问高手们奇怪的问题!!!关于存储过程的
- 请问在C#中如何调用外部程序?急!
- 有关java script调用web servcie问题,高手请指教!
- [求助]请.NET的兄弟帮忙,上传的图片怎么改名?教教我。
- 如何将全角的12转换成半角的12?
- 水晶报表中的IFieldObject,ILineObject,ISection是从什么地方放到报表中的呢?
- 如下正则表达式已经实现主要功能,还有一点功能不知道怎么做请指点
- cookie高分请教
- 我用DataList进行2条信息显示一行的设置,开始好好的,可后来不行了
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","icmlc2006");
newmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","********");