请问一个关于asp.net发邮件的问题,个位大虾救命啊~!~
using System.Web.Mail;
public void sendMail()
{
MailMessage mail1 = new MailMessage();
mail1.Body="body here";
mail1.From="tq668@tq668.com";
mail1.To="zbin8414@yahoo.com.cn";
mail1.Subject="aaaa";
mail1.Priority=MailPriority.High;
mail1.BodyFormat=MailFormat.Text ;
mail1.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1);
mail1.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","sendusername");
mail1.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","sendpassword");
SmtpMail.SmtpServer="mail.tq668.com";
SmtpMail.Send(mail1);
}
这是我的一些参数和方法 配置是绝对没有问题的已经测试过了,但是就是不能成功发送,请问还需要在什么地方配置一下吗?在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!在线等~!~!~!
配置的sendusername和sendpassword因为不方便所以不透露给大家了,高手来啊~!
忘了还有错误信息。。。。。。
The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Runtime.InteropServices.COMException: The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
源错误:
行 67:
行 68: SmtpMail.SmtpServer="mail.tq668.com";
行 69: SmtpMail.Send(mail1);
行 70: }
行 71: }