且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

信箱不可用.服务器响应为:5.7.1 ...我们不中继

更新时间:2021-09-15 21:59:56

似乎您用于SMTP协议的配置导致中继操作( ^ ])

大多数合法的smtp服务器将不支持开放中继,因为垃圾邮件可能会导致滥用.

您需要将应用程序配置为使用适当的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);