SmtpMail.SmtpServer = "localhost" 'smtp服务器地址
SmtpMail.Send(obj)

解决方案 »

  1.   

    public void Mail_Send(Object src,EventArgs e)
    {
    //分别取得邮件的发信人、收信人、主题以及邮件主体等信息
    string strFrom = tbFrom.Text;
    string strTo = tbTo.Text;
    string strSubject = tbSubject.Text;
    string strMsgText = tbMsgText.Text;
    try
    {
    SmtpMail.SmtpServer = "www.aspcn.com";
    SmtpMail.Send(strFrom,strTo,strSubject,strMsgText);
    //清除Label控件中的内容
    tbTo.Text = "";
    tbSubject.Text = "";
    tbMsgText.Text = "";
    lblShowMsg.Text = "发送至<b>"+strTo+"</b>邮件,发送成功";
    }
    catch(Exception ee)
    {
    lblShowMsg.Text = "发送邮件失败:"+ee.ToString();
    }

    }
      

  2.   

    SmtpMail.SmtpServer = "localhost" 'smtp服务器地址
    也可以设置你局域网的smtp服务器为你的smtp
      

  3.   

    书上就没写SmtpMail.SmtpServer = "localhost"
      

  4.   

    绝对要写  :SmtpMail.SmtpServer = "localhost"
      

  5.   

    error:Server Application Unavailable 
    The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the system event log of the web server. Please review this log entry to discover what caused this error to occur. 
      

  6.   

    aspnet_wp.exe 占用cpu 100%