smtp - 使用任意FROM发送邮件 [英] smtp - send mail with arbitrary FROM

查看:533
本文介绍了smtp - 使用任意FROM发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的邮件服务器向客户发送电子邮件,



我使用下面的代码:



web.config

I want to send email from my mail server to client,

I use the code bellow:

The web.config:

<system.net>
    <mailSettings>
      <smtp>
        <network host="mail.mydomain.com" userName="mymail@mydomain.com" password="password" />
      </smtp>
    </mailSettings>
  </system.net>





send_mail.aspx



send_mail.aspx :

MailMessage msg = new MailMessage("senderMail", "recieverMail");
msg.body = "body text";
msg.subject = "msg subject";

SmtpClient smtp = new SmtpClient();
smtp.Send(msg);





这个工作到4天前!使用任何senderMail!



现在我想我应该只使用在我的邮件服务器中验证的电子邮件,例如 mymail@mydomain.com 的。对于其他发件人地址,我收到此错误消息:





This was working till 4 days ago! With any senderMail !

Now I've figured that I should just use the email that is authenticated in my mail server, such as mymail@mydomain.com. for other sender addresses I get this errer message:

...The server response was: From domain must match authenticated domain... 





有没有办法再发送任何发件人地址的邮件!



提前谢谢。



Is there any way to send mails with any sender addresses again !

Thanks in advance.

推荐答案

这与您的代码无关,除了更改服务器之外,您无需做任何事情。使用发送邮件。



它告诉你,空白,服务器要求发件人地址与用于登录SMTP服务器的帐户相匹配。你不能解决这个问题。



好​​吧,除非你把你正在使用的SMTP服务器更改为允许它的服务器。问题是大多数公共服务器都不会因为垃圾邮件而允许你这样做。
This has nothing to do with your code and there is nothing you can do about it, other than changing the server you're using to send mail.

It's telling you, point blank, that the server REQUIRES the sender address to match the account that was used to login to the SMTP server. You cannot get around that.

Well, unless you change the SMTP server you're using to one that does allow it. The problem is that most public servers will not allow you to do that because of spam.


Quote:

使用WebSecureStores SMTP服务器发送电子邮件时,起始地址必须与经过身份验证的地址匹配才能发送。某些设备和电子邮件软件将使用为该站点配置的电子邮件对站点或设备进行身份验证,例如admin@mydomain.com。然后,具有特权级别发送电子邮件的电子邮件user@mydomain.com的站点或设备上的登录用户将使用该软件发送电子邮件。当他们这样做时,SMTP标头会将经过身份验证的用户显示为admin@mydomain.com,将发件人显示为user@mydomain.com,这将导致错误rsp:550 From address必须匹配经过身份验证的地址,并且电子邮件将不会被传递。如果您使用名为admin@mydomain.com的用户在SMTP服务器上进行身份验证,则还必须使用admin@mydomain.com发送电子邮件。

When sending email using WebSecureStores SMTP server the from address must match the authenticated address in order to send. Some devices and email software will have the site or device authenticate with a email configured for the site for example admin@mydomain.com. Then the logged in user on the site or device with email user@mydomain.com that has privileged level to send email will use the software to send an email. When they do this the SMTP header will show the authenticated user as admin@mydomain.com and the sender as user@mydomain.com this will cause an error "rsp: 550 From address must match authenticated address" and the email will not be delivered. If you authenticate on the SMTP server with the user named "admin@mydomain.com" then you must also send the email using "admin@mydomain.com".





-KR



-KR


这篇关于smtp - 使用任意FROM发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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