我用的是web form也就是所谓的aspx界面.
发送按纽消息处理函数里是如下代码....
void theBtnSend_Click(object sender, EventArgs e)
{
System.Web.Mail.MailMessage mailMsg = new System.Web.Mail.MailMessage();
mailMsg.From = theTxtFrom.Text;
mailMsg.To = theTxtTo.Text;
mailMsg.Subject = theTxtSubject.Text;
mailMsg.Body = theTxtContent.Text;
System.Web.Mail.SmtpMail.SmtpServer = "smtp.citiz.net";
try
{
System.Web.Mail.SmtpMail.Send( mailMsg );
theTxtResult.Text = "Sending mail successfully !";
}
catch( Exception ex )
{
theTxtResult.Text = "Error when sending mail for " + ex.Message;
}
}
发送后,出现异常:未能访问CDO.Message对象。
------解决方法--------------------------------------------------------
.Net自带的类库不支持验证,如果你用CDO发送邮件的话,这里有个现成的例子可以提供你参考:
http://wacle.blogdriver.com/wacle/171056.html
------解决方法--------------------------------------------------------