PHP 通过随机电子邮件帐户发送电子邮件
我正在开发一个网站,该网站允许您无需注册也无需指定发件人即可发送电子邮件。您输入收件人的地址、主题、正文并发送。我的问题是发送消息。我想要实现的目标:
用户单击发送 ->发送到 PHP 的主题、收件人、正文 ->服务器验证信息->服务器创建一个随机电子邮件帐户 ->服务器通过创建的随机帐户发送电子邮件-> 帐户
服务器删除了我陷入随机电子邮件帐户创建步骤的 。如何使用 PHP 实现此目的,无需支付我自己的 SMTP 服务器费用,并且无需使用我的自己的 gmail/hotmail 帐户。
我用谷歌搜索了这个问题,但找不到答案。
谢谢!
顺便提一句 我正在使用 Apache 在我自己的 Ubuntu 上“托管”
I'm working on a website that allows you to send emails without registering, and without specifying a sender. You enter the recipient's address, subject, body and send. My problem is sending the message. What I'm trying to achieve:
User clicked send -> Subject,recipient,body sent to PHP -> Server validates the information -> Server creates a random email account -> Server sends the email through the random account created -> Server deletes the account
I'm stuck at the random email account creation step. How do I achieve this with PHP without having to pay for my own SMTP server and without having to use my own gmail/hotmail account.
I googl'd the hell out of this issue and I can't find an answer.
Thanks!
BTW
I'm using Apache to "host" on my own Ubuntu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
创建电子邮件帐户的方法因服务器软件而异,并且通常无法在 PHP 中实现。
不过,根据服务器的配置,这可能不是必需的:如果您为域设置了捕获所有地址,许多服务器配置将允许您从该域上的任何电子邮件发送邮件(例如
< a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6f5e5d5c5b5a595857562f0a170e021f030a410c0002">[电子邮件受保护]
)。然后,任何回复都将发送到该万能邮箱,您可能想丢弃其中的内容。但您必须意识到,这正是垃圾邮件提供商的运作方式。如果您不想被列入各种垃圾邮件黑名单,建议您格外小心。
The way to create E-Mail accounts varies wildly from server software to server software, and is usually not possible from within PHP.
Depending on your server's configuration, though, that might not be necessary: If you set up a catch all address for a domain, many server configurations will allow you to send out mails from any E-Mail on that domain (e.g.
[email protected]
). Any responses will then go to that catch-all mailbox, the contents of which you will probably want to discard.You have to realize, though, that this is exactly how spam providers operate. Extreme caution is advised if you don't want to end up on all sorts of spam blacklists.
我不相信您可以使用 PHP 在服务器上创建帐户或电子邮件帐户,因为这会取代 PHP 的权限级别。仅供参考,以这种方式发送电子邮件是禁止服务器的好方法。另外,如果您坚持要发送这样的电子邮件,为什么不指定一个虚拟的
From:
电子邮件地址呢?无论如何,这本质上与创建虚拟帐户是一样的。对于 PHP 的
mail()
,您可能还想使用-f
开关。请参阅 php.net/manual/en/function.mail.phpI don't believe you can create accounts or email accounts on a server, using PHP, as this supersedes PHP's permission level. Sending emails this way is a good way to get your server banned, FYI. Also, if you insist on sending emails like this, why not just specify a dummy
From:
email address? It would essentially be the same thing as creating a dummy account anyhow.You may also want to use the
-f
switch, for PHP'smail()
. See php.net/manual/en/function.mail.php