Page 1 of 1

Sending failed using mail() as PHP's default mail()

Posted: Fri Feb 15, 2008 7:48 am
by anjanesh

Code: Select all

[14-Feb-2008 17:35:54] PHP Fatal error:  Uncaught exception 'Swift_ConnectionException' with message 'Sending failed using mail() as PHP's default mail() function returned boolean FALSE.' in /var/www/vhosts/my-domain.com/httpdocs/lib/Swift/Plugin/MailSend.php:166
Stack trace:
#0 /var/www/vhosts/my-domain.com/httpdocs/lib/Swift/Plugin/MailSend.php(146): Swift_Plugin_MailSend->doMail('mail@CarCr...', 'Subject', '<html><head><ti...', Object(Swift_Message_Headers), '-oi -f noreply@...')
#1 /var/www/vhosts/my-domain.com/httpdocs/lib/Swift.php(171): Swift_Plugin_MailSend->sendPerformed(Object(Swift_Events_SendEvent))
#2 /var/www/vhosts/my-domain.com/httpdocs/lib/Swift.php(462): Swift->notifyListeners(Object(Swift_Events_SendEvent), 'SendListener')
#3 /var/www/vhosts/my-domain.com/httpdocs/script-2.php(101): Swift->send(Object(Swift_Message), 'mail@e-CarCr...', Object(Swift_Address))
#4 /var/www/vhosts/my-domain.com/httpdocs/script-2.php(69): sendMail()
#5 /var/www/vhos in /var/www/vhosts/my-domain.com/httpdocs/lib/Swift/Plugin/MailSend.php on line 166
 
Using NativeMail because SMTP through another domain on another server is somehow blocked.
But even NativeMail isnt working on this particular server.
Is there I need to check for for mail() ? Possibly something that blocking port 25 ?

Thanks

Re: Sending failed using mail() as PHP's default mail()

Posted: Fri Feb 15, 2008 4:34 pm
by Chris Corbyn
Sounds like mail() is disabled or not configured in php.ini. What happens when you try a simple mail() script?

Re: Sending failed using mail() as PHP's default mail()

Posted: Sat Feb 16, 2008 7:36 am
by anjanesh

Code: Select all

ini_set("display_errors", "1");
error_reporting(E_ALL + E_STRICT);
.
.
.
if (!mail($to, $subject, $message, $headers))
 echo "Couldnt mail";
Oddest thing - when run in the browser, it shows Couldnt mail.
But in shell, nothing - no error - no msg - nothing.

How do I trace this ?

Re: Sending failed using mail() as PHP's default mail()

Posted: Sat Feb 16, 2008 4:07 pm
by Chris Corbyn
What if you put an else in there? It's probably succeeding in the shell (since it won't be reading from php.ini and will assume defaults).