用于发送邮件而不指定发件人密码的代码 [英] code for sending mail without specifying senders password

查看:85
本文介绍了用于发送邮件而不指定发件人密码的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于从网站用户向其管理员发送电子邮件而无需指定用户密码的代码

code for sending email from users of the site to its admin without specifying users password

推荐答案

在大多数情况下,您无法做到。除非电子邮件服务器配置为允许匿名电子邮件(我还没有看到),您必须提供用户名和密码才能发送任何电子邮件,甚至是内部电子邮件。这通常是为了防止电子邮件系统被用作垃圾邮件源。
You can''t, in most cases. Unless the email server is configured to allow anonymous emails (and I haven''t seen one which is) you have to provide a username and password in order to send any email, even internal ones. This is generally to prevent the email system being used as a spam source.


为此目的创建一个额外的用户,并使用他的凭据从您的应用程序发送邮件。

最后,您仍需要用户名和密码,但不需要申请人的实际用户。
Create an extra user for that purpose, and use his credentials for sending mails from your application.
In the end, you still need username and password, but not of the actual user of your application.


这篇关于用于发送邮件而不指定发件人密码的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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