如果没有主机,用户名和密码等SMTP设置,我必须发送邮件.有可能在
PHP或任何其他语言?
解决方法
是的,可以使用
mail()功能执行此操作.但请考虑以下限制:
Note: The Windows implementation of mail() differs in many ways from the Unix implementation. First,it doesn’t use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second,the custom headers like From:, Cc:,Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. As such,the to parameter should not be an address in the form of “Something “. The mail command may not parse this properly while talking with the MTA.
Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email,which is not very efficient.
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|