无法从 php 通过电子邮件发布到 Facebook 页面

发布于 2024-12-27 04:25:28 字数 623 浏览 4 评论 0原文

您可以将状态更新发送到您拥有的 Facebook 页面,方法是将其发送到一个白痴(秘密)电子邮件地址。这是在这里描述的: http://www.facebook.com/help/pages/mobile 问题是我无法使其从 php 工作,

function page_publish_by_mail($page_mail, $status){
    $to = $page_mail;
    $subject = $status;
    $message = "";
    $headers = "From: [email protected]";   
    return mail($to, $subject, $message, $headers);
}

我可以将邮件发送到我的电子邮件地址,并且我可以从我的电子邮件地址通过邮件发布,但我似乎无法从 PHP 通过邮件发布。

you can send a status update to a facebook page you own by sending it to a cretin (secret) email address. this is described here:
http://www.facebook.com/help/pages/mobile
the problem is I cant make it work from php

function page_publish_by_mail($page_mail, $status){
    $to = $page_mail;
    $subject = $status;
    $message = "";
    $headers = "From: [email protected]";   
    return mail($to, $subject, $message, $headers);
}

I can send mail to my email address and I can post by mail from my email address but I can't seem to post by mail from PHP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

2025-01-03 04:25:28

我以前没有尝试过发送到 Facebook 邮件,但我觉得它由于缺少标题信息而被过滤掉。尝试添加更多标题详细信息。

我总是发送这样的标头:

$headers  = 'From: Your Name <[email protected]>' . "\r\n";
$headers .= 'Content-type: text/html' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";

这设置为发送 html 电子邮件,但如果这不起作用,您可以尝试其他内容类型。

查看文档并查看是否还需要其他标头可能是个好主意。

I haven't tried to send to facebook mail before, however I feel like it is being filtered out due to lack of header information. Try adding some more header details.

I always send headers like this:

$headers  = 'From: Your Name <[email protected]>' . "\r\n";
$headers .= 'Content-type: text/html' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";

This is set up to send an html email, but you might try other content-types if that doesn't work.

It may be a good idea to look in the documentation and see if there are other headers that are required as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文