I'm having problems with symfony 1.4 swiftmailer. When I try to use the sendmail () function, I received an error code:
Caught exception: Expected response code 250 but got code "", with message ""
And symfony does not send messages.
Below is my sendmail function
static function sendmail($mail, $textmessage, $subject) { try { $message = Swift_Message::newInstance() ->setFrom(sfConfig::get('app_mail_address_from')) ->setTo($mail) ->setSubject($subject) ->setBody($textmessage) ->setContentType("text/html"); // sfContext::getInstance()->getMailer()->send($message); sfContext::getInstance()->getMailer()->send($message); // mail("mymailcom", "A subject", "A message", "FROM: noreply@mail.com "); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } }
What I tried to do:
My server: CentOs6 on the server godaddy.co.uk
Can someone please help me with this error?
source share