PHP - 指定发送邮件的 SMTP 服务器
我正在使用 PHP 的 IMAP 库为基于 IMAP 的电子邮件服务开发一个简单的 Webmail 客户端,我想知道是否有任何方法可以指定发送外发消息时要使用的 SMTP 服务器,以便该消息将被放置在用户的当他们登录 IMAP 帐户时发送邮箱。我看到它们是一个 imap_mail() 函数,但是从文档中看起来它基本上只是普通 mail() 函数的别名,或者我的假设是错误的?
I am developing a simple webmail client for IMAP-based email services using PHP's IMAP library, and I was wondering if there was any way to specify the SMTP server to use when sending an outgoing message, so that the message will be placed in the user's Sent mailbox when they are logged into their IMAP account. I saw that their is an imap_mail() function however it looks from the docs like it is just basically an alias for the normal mail() function, or am I wrong in assumming that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不使用功能齐全的类来实现此功能,例如 PHPMailer?
Why don't you use a full featured class for this function, like PHPMailer?
将副本保存到“已发送邮件”文件夹是 IMAP 的一项功能,与排队邮件通过 SMTP 传送完全无关。也就是说,您的代码必须分别执行这两项操作——其中一个操作并不意味着另一个操作。
Saving a copy to the Sent Mail folder is a function of IMAP, and is completely unrelated to queuing the message for delivery via SMTP. I.e., your code will have to do both operations separately -- one does not imply the other.
我注意到 Gmail 会自行将副本添加到已发送文件夹中。这是大型网络邮件提供商的常见行为吗?
I have noticed that Gmail adds a copy to the sent folder on its own. Is this common behavior for the big web-mail providers?