smtp发邮件问题?
MailMessage mail = new MailMessage();
mail.To = "hm8030@163.com ";
mail.From = "bbb@163.com ";
mail.Subject = "this is a test email. ";
mail.Body = "Some text goes here ";
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ", "1 ");
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ", "hm8030 ");
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ", "8030960 ");
SmtpMail.SmtpServer = "smtp.163.com ";
try
{
SmtpMail.Send(mail);
}
catch (Exception ex)
{
//this.WriteLogTxt( "ErrorMessage: "+ex.Message,false);
this.Label1.Text = ex.Message;
// return false;
}
行提示:
Could not create an object of type 'CDO.Message '. Please verify that the current platform configuration supports SMTP mail.
我不知道到底那出了。在等!!
[解决办法]
帮你顶了。自己没碰过类似的错误!我发邮件都是用第三方的组件发的。
[解决办法]
当初记得也出现过 去网上查了一下 发现这个组建问题多 就改用jmail了 很方便
lz可以去网上查一下 资料还是很多的
[解决办法]
是啊!
如果要发的邮件不是很重要的话是可以考虑用第三方组件来实现
[解决办法]
http://blog.csdn.net/tianzhenjing/archive/2006/12/22/1454413.aspx
[解决办法]
你的操作系统没有装smtp服务
[解决办法]
你的服务器可能没有配置好。
[解决办法]
以前就因为这个问题一直得不到解决,所以就不使用 System.Web.Mail 了
http://www.cnblogs.com/yyw84/archive/2006/12/22/600686.html
[解决办法]
iis 设置允许smtp转发
------解决方案--------------------
用下面这段吧,可以成功发送
//使用指定的SMTP服务器发送电子邮件
SmtpClient SmtpMail = new SmtpClient( "smtp.163.com ");
SmtpMail.Credentials = new System.Net.NetworkCredential( "用户名 ", "密码 ");
SmtpMail.Send(Mail);
[解决办法]
如果是在2.0下应该使用System.Net.Mail 命名空间而不是 System.Web.Mail, 好好查下MSDN