views:

30

answers:

0

Hi all!

I wanna subscribe my website newsletter members to my Google Group automatically.

I try send email to [email protected] with subject & body "subscribe" by PHP Mail function from user email. but not any result and subscription resquest in my group.

$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('[email protected]');

    $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();
}

Can any one help me!