发送没有凭证的邮件

问题描述:

我的asp.net应用程序中存在问题。我使用SMTP服务器凭据发送电子邮件。它包括主机名smtp.gmail.com,端口号= 587,用户名=somemai ... @ gmail.com密码=。我创建了一个邮件消息对象,并将from和to地址设置为fr ... @ gmail.com,t ... @ gmail.com。我收到了电子邮件,但是id始终被视为用户名,即somemai ... @ gmail.com。怎么回事?如何将电子邮件地址更改为fr ... @ gmail.com?

I have an issue in my asp.net application. I am using SMTP server credentials to send emails. It includes a hostname smtp.gmail.com, port no=587, username="somemai...@gmail.com" password="". I have created a mail message object and set the from and to address to "fr...@gmail.com","t...@gmail.com". I am getting emails, but the from id is always taken as the username ie,somemai...@gmail.com. How it happens? How can I change the email address to fr...@gmail.com?

您无法更改它。最后我查了一下,GMail不允许你设置From地址与用来发送的帐户不同。
You can't change it. Last I checked, GMail doesn't allow you to set the From address different from the account that's being used to send.


我相信唯一真正的方法是找到一个打开用于发送电子邮件的SMTP中继。

这不需要任何形式的身份验证,因此可以将电子邮件发送给任何您想要的人。
I believe the only real way to do this would be to find an open SMTP relay to use to send the e-mail.
This would not require any form of authentication and so would be able to send the e-mail as being from whoever you wish.