Mailer Error: SMTP() requires user credentials

房东的猫 提交于 2019-12-13 08:36:54

问题


I have a system where when the user registers, system will send an email to the user with activation link. I am doing this process using SMTP connect(). But it asks for user's credentials ( with password) to whom I want to send the email, which makes no sense in the production level. How can I do this without knowing the user credentials?


回答1:


This has been covered many times on here - gmail doesn't allow you to send from arbitrary addresses, and asking for user's credentials to allow sending from their account is just bonkers; nobody should ever do that. Don't send from the user; send from your own address and use the submitter's address as a reply-to address. That way you only need your own credentials and will not be forging the from address.



来源:https://stackoverflow.com/questions/43815571/mailer-error-smtp-requires-user-credentials

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!