简体   繁体   English

配置邮件服务器以将电子邮件发送到 PHP 脚本

[英]Configuring a mail server to send emails to a PHP script

Okay, so as a kind of proof of concept, I am trying to set up a mail server to send emails to a PHP script.好的,作为一种概念证明,我正在尝试设置邮件服务器以将电子邮件发送到 PHP 脚本。 It's important that the attachments can be accessed, preferably in the same way file uploads from a basic web upload are accessed.可以访问附件很重要,最好以与访问基本 Web 上传的文件上传相同的方式访问。

One of the largest problems is I don't even know where to start, I have never attempted anything complex regarding mail servers.最大的问题之一是我什至不知道从哪里开始,我从未尝试过任何关于邮件服务器的复杂问题。

To clarify exactly what I want to know: is there a way that, if someone sends an email to example@example.com, a PHP script would run and have access to the emails content including headers and attachments?为了明确我想知道的内容:有没有办法,如果有人向 example@example.com 发送电子邮件,PHP 脚本将运行并可以访问包括标题和附件在内的电子邮件内容? If so, could you also point me in the right direction to learn more?如果是这样,您能否也为我指出正确的方向以了解更多信息?

Thank you谢谢

Assuming you're not planning to write a mail server using PHP, you will need to integrate with an existing mail server.假设您不打算使用 PHP 编写邮件服务器,您将需要与现有的邮件服务器集成。 I don't have experience with that but one thing you could look into is using AWS SES.我没有这方面的经验,但您可以研究的一件事是使用 AWS SES。 It is possible to receive emails at AWS SES and then have them processed in various ways (eg stored in AWS S3).可以在 AWS SES 接收电子邮件,然后以各种方式处理它们(例如存储在 AWS S3 中)。 Then they can also be accessed by a PHP script using AWS API (AWS offers a really good PHP SDK that makes it quite easy to access all of their services).然后它们也可以通过使用 AWS API 的 PHP 脚本访问(AWS 提供了一个非常好的 PHP SDK,可以很容易地访问他们的所有服务)。

Read some more here: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html在此处阅读更多信息: http : //docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM