【问题标题】:Google Groups Subscription By PHP通过 PHP 订阅 Google Groups
【发布时间】:2011-04-11 08:29:10
【问题描述】:

我想将我的网站时事通讯成员自动订阅到我的 Google 网上论坛。

我尝试通过 PHP 邮件功能从用户电子邮件向 mygroupname+subscribe@googlegroups.com 发送主题和正文“订阅”的电子邮件。但我的组中没有任何结果和订阅请求。

  $phpMailSender = new PHPMailer();
  $phpMailSender->CharSet = "UTF-8";

  foreach($users as $user) {
        $phpMailSender->ClearAddresses();

        $phpMailSender->From = $user['email'];
        $phpMailSender->FromName = $user['email'];
        $phpMailSender->AddReplyTo($user['email']);

        $phpMailSender->addAddress('mygroupname+subscribe@googlegroups.com');

        $phpMailSender->Subject = 'subscribe';
        $phpMailSender->Body = 'subscribe';
        $result = $phpMailSender->send();

        if($result)
                echo "Subscription email Sent for user# " . $user['email'] . "\n";
        else
                echo "Subscription email failed for user# " . $user['email'] . "\n";

        ob_flush();
        flush();
  }

谁能帮帮我!

【问题讨论】:

  • 问题以问号结尾。您确定正在发送邮件吗?你能提供一些代码吗?
  • 一些代码添加到我的问题中;)
  • @Akbar 你有没有想过如何通过电子邮件添加用户?

标签: php subscription google-groups


【解决方案1】:

在查看question in the hMailServer 论坛时。

那里的人给出了一些关于如何做到这一点的想法(尽管没有代码),但有很好的考虑。

但除了让用户订阅列表之外,还涉及更多内容。您还需要验证用户提供的电子邮件地址,这样人们就不会输入其他人的电子邮件地址。这将通过向用户发送电子邮件并要求他确认订阅来完成。当他单击链接进行确认时,他会转到您的网页,该网页与某处的数据库条目有关,然后电子邮件会以您尝试的方式添加到列表中。

但请查看我上面提供的链接以了解更多注意事项。

Here is another similar thread.

代码,there is a snippet here

This thread also has some php code,和你的类似——你应该看看这个。

【讨论】:

    猜你喜欢
    • 2013-08-27
    • 1970-01-01
    • 2013-03-09
    • 2018-05-31
    • 2017-10-07
    • 1970-01-01
    • 1970-01-01
    • 2012-10-01
    • 2015-06-07
    相关资源
    最近更新 更多