Page 1 of 1

batchSend() not working on my new webhost

Posted: Thu Mar 20, 2008 2:34 am
by Josh1billion
I've never had any problems with Swift Mailer until using my new webhost, now I have this problem: messages aren't being sent out.

I'm using batchSend() to send a message to all of my members. I have a bunch of setup code (to build $message, $recipients, etc.), and then these two lines of code after that:

Code: Select all

 
    $number_sent = $swift->batchSend($message, $recipients, new Swift_Address("noreply@seedsoftime.net", "Seeds of Time Online"));
    
    print "Message sent to <b>$number_sent recipients</b>.";
The message my page displays is "Message sent to 0 recipients." Odd since it was working with my previous hosts. The only thing I changed in the code was the message's text (which, of course, wouldn't affect anything).

Is there some option my host has disabled for e-mail-related activity? Btw, I'm using PHP 5 (5.2 I believe, same version as on my last host).

Re: batchSend() not working on my new webhost

Posted: Thu Mar 20, 2008 5:32 am
by Chris Corbyn
What does this show?

Code: Select all

<?php
 
require_once 'lib/Swift.php';
require_once 'lib/Swift/Connection/SMTP.php';
 
$log = Swift_LogContainer::getLog();
$log->setLogLevel(4);
 
// .. Add your existing code here
 
echo '<pre>', htmlentities($log->dump(true)), '</pre>';

Re: batchSend() not working on my new webhost

Posted: Thu Mar 20, 2008 5:06 pm
by Josh1billion
EDIT: Nevermind, I figured it out thanks to the log. :)

Here's what the problem was: I was sending from noreply@seedsoftime.net, but I didn't have that "noreply@seedsoftime.net" e-mail address actually created in cPanel. For some reason, this host won't send an e-mail unless the "from" address actually exists, while the other hosts didn't complain.

Thanks for your help, Chris!