SMTP可以接受具有错误发件人姓名的电子邮件
问题描述:
我正在使用SMTPClient
将电子邮件发送到SMTP服务器.但是,使用Send
方法,我可以指定任何错误的发件人姓名或电子邮件.我该如何预防?
I'm using SMTPClient
for sending emails to a SMTP server. But with Send
method I can specify any false sender name or email. How can I prevent this?
答
确定邮件服务器作为发件人的电子邮件地址是您的工作,这只是政策问题.
It's the job of your mail server to decide on what it accepts as a sender email address - that's just a matter of policy.
邮件客户端没有真实的"电子邮件地址,因此客户端无法执行任何操作.
There is no 'true' email address for a mail client, so nothing that can be enforced at the client.