虚拟邮件服务器

虚拟邮件服务器

在我的开发电脑上,我想使用 PHPmail()函数查看所有已发送的邮件。是否有任何虚拟邮件服务器可以显示所有已发送的邮件(无论收件人是谁)并将它们收集到邮箱中以供预览?

答案1

干得好:smtp4dev

与 Windows 7/Vista/XP/2003/2010 兼容的虚拟 SMTP 服务器。位于系统托盘中,不传送收到的消息。可以快速查看、保存收到的消息并检查其来源/结构。适用于测试/调试生成电子邮件的软件。

答案2

如果您有 Windows 环境,phi 的解决方案非常棒。

如果您有 Linux 环境 - 那么您可以设置 postfix 将所有电子邮件发送到本地邮箱。

以下是帮助您入门的链接 -https://serverfault.com/questions/144325/how-to-redirect-all-postfix-emails-to-one-external-email-address

Create /etc/postfix/virtual-regexp with the following content:

/.+@.+/ [email protected]
Edit /etc/postfix/main.cf and add regexp:/etc/postfix/virtual-regexp to the virtual_maps configuration. The end result might look like this in main.cf:

virtual_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp
Build the mapfile by typing:

postmap /etc/postfix/virtual-regexp
This also requires a virtual.db to exist. If it doesn't create an empty file called virtual and run : postmap /etc/postfix/virtual

Voila!

相关内容