信箱不可用.服务器响应为:5.7.1 ...我们不中继 [英] Mailbox unavailable. The server response was: 5.7.1 ... we do not relay

查看:210
本文介绍了信箱不可用.服务器响应为:5.7.1 ...我们不中继的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我的网站发送邮件:这是我后面的代码:

I''m trying to send mail from my site :here is my code behind :

MailMessage myMessage = new MailMessage();
       myMessage.Subject = "This is just for checking the EMail <N.n>";
       myMessage.Body = TextBox2.Text;
       myMessage.From = new MailAddress("me@mysite.com", "mysite.com");
       myMessage.To.Add(new MailAddress(TextBox1.Text, TextBox1.Text));

       SmtpClient mySmtpClient = new SmtpClient();
       mySmtpClient.Send(myMessage);



这是我的web.config:



and here my web.config:

<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network host="smtp.mysite.com" userName="mysite.com" password="mypass" />
      </smtp>
    </mailSettings>
  </system.net>



但我有这个错误:



but I have this Error:

Server Error in '/' Application.
--------------------------------------------------------------------------------
Mailbox unavailable. The server response was: 5.7.1 <x@yahoo.com>... we do not relay <me@mysite.com>


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 <nima18n2000@yahoo.com>... we do not relay <N.N@nimanaqipour.com>
Source Error:

Line 31:
Line 32:         SmtpClient mySmtpClient = new SmtpClient();
Line 33:         mySmtpClient.Send(myMessage);
Line 34:     }
Line 35: }

推荐答案

似乎您用于SMTP协议的配置导致中继操作(
It looks like the configuration you are using for the SMTP protocols are resulting in a relaying operation (http://en.wikipedia.org/wiki/SMTP_relay[^])

The majority of legitimate smtp server will not support open relaying due to the abuse that can occur from spamming.

You will need to configure your application to use an appropriate SMTP gateway, which will therefore probably require authentication to be added into the equation.


这意味着您必须在上使用帐户该服务器以发送电子邮件. 中继"是允许某人使用您的
的行为 服务器具有在服务器上找不到的发件人"地址.
What that means is that you have to use an account on that server in order to send emails. "Relay" is tha act of letting someone use your
server with a "from" address that is not found on the server.


必须以这种方式使用,伙计们,我用过它并且工作了!

Must use in this way guys,I used this and worked!

SmtpClient client = new SmtpClient("mail.somecompany.com", 25);

          // Configure the SmtpClient with the credentials used to connect
          // to the SMTP server.
          client.Credentials =
              new NetworkCredential("user@somecompany.com", "password");

          // Create the MailMessage to represent the e-mail being sent.
          using (MailMessage msg = new MailMessage())
          {
              // Configure the e-mail sender and subject.
              msg.From = new MailAddress("me@me.com");
              msg.Subject = "hi";

              // Configure the e-mail body.
              msg.Body = "Hi.";

              // Attach the files to the e-mail message and set their MIME type.
              msg.Attachments.Add(
                  new Attachment(@"..\..\Recipe10-07.cs","text/plain"));
              msg.Attachments.Add(
                  new Attachment(@".\Recipe10-07.exe",
                  "application/octet-stream"));
}
client.Send(msg);


这篇关于信箱不可用.服务器响应为:5.7.1 ...我们不中继的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆