我是程序如下
private void btnSend_Click(object sender, System.EventArgs e)
{
MailMessage message = new MailMessage();
message.From = txtSender.Text;
message.To = txtRecipient.Text;
message.Subject = txtSubject.Text;
message.Body = txtBody.Text;

try
{
SmtpMail.SmtpServer = "";
SmtpMail.Send(message);
}
catch(Exception ex)
{
Response.Write(ex.Message);
}

解决方案 »

  1.   

    make sure your SMTP Service is properly set up
      

  2.   

    orSmtpMail.SmtpServer = "PutYourSMTPServerNameHere";
      

  3.   

    Your method is not a good idea.
    I have not solve the problem yet.
      

  4.   

    我已经在引用中添加了C:\Windows\system32\cdosys.dll
      

  5.   

    下面是一个示例,引用CDO(Microsoft CDO For Exchange 2000 Library)
    Configuration conf=new ConfigurationClass();
       
    conf.Fields[CdoConfiguration.cdoSendUsingMethod].Value=CdoSendUsing.cdoSendUsingPort;
    conf.Fields[CdoConfiguration.cdoSMTPServer].Value="smtp.21cn.com";
    conf.Fields[CdoConfiguration.cdoSMTPServerPort].Value=25;
    conf.Fields[CdoConfiguration.cdoSMTPAccountName].Value="hydnoahark";
    conf.Fields[CdoConfiguration.cdoSendUserReplyEmailAddress].Value="\"c_zc\" <[email protected]>";
    conf.Fields[CdoConfiguration.cdoSendEmailAddress].Value="\"c_zc\" <[email protected]>";
    conf.Fields[CdoConfiguration.cdoSMTPAuthenticate].Value=CdoProtocolsAuthentication.cdoBasic;
    conf.Fields[CdoConfiguration.cdoSendUserName].Value="c_zc";
    conf.Fields[CdoConfiguration.cdoSendPassword].Value="******";
    conf.Fields.Update();
    MessageClass msg=new MessageClass();
    msg.Configuration=conf;
    msg.To="[email protected]";
    msg.Subject="收到否";
    msg.TextBody="It's test";
    msg.From="[email protected]";
      

  6.   

    我是想用System.Web.Mail名称空间提供的方法来实现
    而不想用楼上仁兄提供的方法。
      

  7.   

    can you show use more detailed error messages? ASP.Net uses the SMTP service to send emails. Verify that this service is running and configured to send mails> Run Internet Information Services (IIS) 
    > Right click on the default SMTP Server, select Properties
      

  8.   

    如果你装了防毒软件的话,请关掉"关闭邮件发关送监控",我也碰到过这个问题。另外邮件服务器是本机的话,请安装“SMTP”服务。
      

  9.   

    楼上的大哥,我用的是诺顿,把E-mail Scanning关了还是不行,
    SMTP的配置也没有什么问题,都是按默认值设置的也没有其他的错误提示了,就是Exception.Message是未能访问“CDO.Message”对象
      

  10.   

    IIS中的Smtp怎么设置才能正常工作?
      

  11.   

    To:jb2008(飞天.net) 大侠请指教!
      

  12.   

    使用 yarshray(saga jion) 的方法能利用需要验证的SMTP服务器发送邮件,.net自带的mail组件不具备这种功能。此段代码已通过测试(21cn.com)。
    有问题再联系
      

  13.   

    MessageClass这个东东我怎么找不到
      

  14.   

    我用smtp.sina.com被拒绝了,呵呵,上面说需要验证,怎么做?