This error is usually related with SMTP server setting. In some cases, it 
is the wrong smtp server name or wrong DNS entry. Here I would suggest:
1. Double check the SMTP server is listen on port 25;
2. The SMTP grant permission to the ASP.NET application to send email. The 
default security account for ASP.NET application is <ServerName>\ASPNET.

解决方案 »

  1.   

    to:idiotzeng(白痴) 
           可以具体详细一点吗?老兄,帮忙具体一点
      

  2.   

    以前我在windows程序也可以的,重装了,不知道是不是配置的问题,Windows下面也不可以了,这是ASP.NET下面的代码,帮忙看看是否又问题,谢谢public void SendEmail(string EmailAddress,string BugDescript)
    {
    MailMessage newMail=new MailMessage();
    newMail.From = "[email protected]";
    newMail.To = EmailAddress;
    newMail.Subject = "Bug Notify !";
    newMail.Body = BugDescript;
    newMail.BodyFormat = MailFormat.Html;
    SmtpMail.SmtpServer="smtp.163.com";
    SmtpMail.Send(newMail);
                        }同意楼上的 163的smtp是要验证的,你可以使用SmtpMail.SmtpServer="localhost";
    前题是,启动在你的iis中smtp服务器,在访问选项卡中的,中继,把本地ip添加
      

  3.   

    第二种方式:
    private void btnSend_Click(object sender, System.EventArgs e)
    {
    // change the cursor to hourglass
    Cursor appCursor = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;

    string sendString; byte [] dataToSend; string receiveData; try
    {
    // creating an instance of the TcpClient class
    TcpClient smtpServer = new TcpClient(txtSmtpServer.Text, 25);

    lstLog.Items.Add("Connection Established with " + txtSmtpServer.Text);

    // creating stream classes for communication
    NetworkStream writeStream = smtpServer.GetStream();
    StreamReader readStream = new StreamReader(smtpServer.GetStream());

    // receiving connection success
    receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData); // sending From Email Address
    sendString = "MAIL FROM: " + "<" + txtFrom.Text + ">\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData);
                    
    // sending To Email Address
    sendString = "RCPT TO: " + "<" + txtTo.Text + ">\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData); // sending data
    sendString = "DATA " + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData);

    // sending Message Subject and Text
    sendString = "SUBJECT: " + txtSubject.Text + "\r\n" + txtMessage.Text + "\r\n" + "." + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData); // sending Disconnect from Server
    sendString = "QUIT " + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog.Items.Add(receiveData); // closing all open resources
    writeStream.Close();
    readStream.Close(); smtpServer.Close();
    }
    catch(SocketException se)
    {
    MessageBox.Show("SocketException:" + se.ToString());
    }
    catch(Exception excep)
    {
    MessageBox.Show("Exception:" + excep.ToString());
    } // restoring the cursor state
    Cursor.Current = appCursor; } private void btnReceive_Click(object sender, System.EventArgs e)
    { // change the cursor to hourglass
    Cursor appCursor = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;

    string sendString; byte [] dataToSend; string receiveData; try
    {
    TcpClient popServer = new TcpClient(txtPopServer.Text,110);

    NetworkStream writeStream = popServer.GetStream();
    StreamReader readStream = new StreamReader(popServer.GetStream()); // connect with the server
    receiveData = readStream.ReadLine();
    lstLog2.Items.Add(receiveData); // sending username to the server
    sendString = "USER " + txtUserName.Text + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog2.Items.Add(receiveData); // sending password to the server
    sendString = "PASS " + txtPassword.Text + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog2.Items.Add(receiveData); // getting the number of emails on the server
    sendString = "STAT" + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog2.Items.Add(receiveData);

    // parse the returned number into integer
    Match m = Regex.Match(receiveData,@"(\s\d*\s)");
    int nMails = 0; if (m.Success)
    {
    nMails = int.Parse(m.ToString());
    } // reading emails in a loop


    for (int index = 1; index <= nMails; index++)
    {
    string szTemp; // reading individual email
    MessageBox.Show("Reading Email:" + index.ToString());
    sendString = "RETR " + index.ToString() + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    szTemp = receiveData;

    while(receiveData != ".")
    {
    receiveData = readStream.ReadLine();
    szTemp = szTemp + "\r\n" + receiveData;
    }

    txtEmails.Text = txtEmails.Text + 
    index.ToString() + "\r\n" + 
    szTemp + "\r\n";
    //lstMsgList.Items.Add(receiveData); }

    // Disconnect from the server
    sendString = "QUIT" + "\r\n";
    dataToSend = Encoding.ASCII.GetBytes(sendString);
    writeStream.Write(dataToSend,0,dataToSend.Length); receiveData = readStream.ReadLine();
    lstLog2.Items.Add(receiveData); // freeing all open resources
    writeStream.Close();
    readStream.Close();

    popServer.Close();
    }
    catch(SocketException se)
    {
    MessageBox.Show("SocketException:" + se.ToString());
    }
    catch(Exception excep)
    {
    MessageBox.Show("Exception:" + excep.ToString());
    } // restoring the cursor state
    Cursor.Current = appCursor; }
    }
    }
      

  4.   

    我的mail程序就是参考这几个地方做的,不错
    http://www.c-sharpcorner.com/asp/Code/SendMailDCHK.asp
    http://www.c-sharpcorner.com/Internet/MailingAppMG.asp
    http://www.codeproject.com/csharp/httpmail.asp?target=mail