Ho problemi con symfony 1.4 swiftmailer. Quando cerco di usare la funzione sendmail() ho avuto il codice di errore:Swiftmailer Caught exception: codice di risposta previsto 250 ma ha ottenuto il codice "", con messaggio ""
Caught exception: Expected response code 250 but got code "", with message ""
E symfony non invia messaggi.
Qui di seguito è la mia funzione di sendmail
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: [email protected]");
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
Quello che ho cercato di fare:
ho cercato di testare la funzione mail(). Funziona bene.
Ho provato a cambiare le impostazioni SMTP per account Gmail - non funziona
Il mio server è: CentOs6 sul server di godaddy.co.uk
Qualcuno può per favore mi aiuti con questo errore?
Eventuali duplicati: http://stackoverflow.com/ questions/11158845/fatal-error-when-trying-to-send-email-using-swiftmailer-and-sendgrid –
Questo articolo ha aiutato –