2014-10-10 11 views
5

mesajıyla birlikte Symfony 1.4 swiftmailer'da sorun yaşıyorum. mesajları göndermezSwiftmailer Yakalanan istisna: Beklenen yanıt kodu 250 "", "

Caught exception: Expected response code 250 but got code "", with message "" 

Ve Symfony: Ben sendmail işlevini kullanmaya çalıştığınızda () hata kodu var.

Aşağıda yapmaya çalıştığım ne

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"; 
    } 


} 

sendmail'i benim fonksiyonudur:

  1. ben posta() fonksiyonunu test etmeye çalıştı. İyi çalışıyor. CentOs6 godaddy.co.uk sunucuda

    birileri bu hata ile bana yardım edebilir:

Benim Sunucusu çalışmıyor -

  • Ben gmail hesabına smtp ayarlarını değiştirmek için çalıştı?

    +1

    Olası yinelenen: http://stackoverflow.com/ soruları/11158845/fatal-error-e-posta-kullanarak-çalışırken-e-posta-kullanarak-swiftmailer-ve-sendgrid –

    +0

    Bu makalede, –

    cevap

    4

    Tamam, yorum yapmaktan sonrası yardımcı Belki biri o kullanacak: Sorunun swiftmailer olduğunu düşünüyorum:

    try { 
    
         $transport = Swift_MailTransport::newInstance(); 
         $mailer = Swift_Mailer::newInstance($transport); 
         $message = Swift_Message::newInstance('Subject') 
          ->setFrom(sfConfig::get('app_mail_address_from')) 
          ->setTo($mail) 
          ->setSubject($subject) 
          ->setBody($textmessage) 
          ->setContentType("text/html"); 
         $mailer->send($message); 
        } catch (Exception $e) { 
         echo 'Caught exception: ', $e->getMessage(), "\n";die; 
        } 
    

    Bu çalışıyor kod

    +0

    kodunuzu kontrol edin, bir şey satır [email protected] "); –

    İlgili konular