2011-03-02 7 views
0

Symfony 프레임 워크를 사용하여 이메일을 보내려고 할 때이 오류가 발생합니다. 나는이 문제를 잠시 뒤로 돌리고 (막연하게) php.ini 설정을 변경하고 그것을 /app/config/factories.yml에 매치시켜 작동 시키도록해야했다.Swift 메일과 Symfony ([Connection refused # 111])

불행히도 최근에 컴퓨터를 재구성해야하고 메일이 작동을 멈췄습니다. 불행히도 지난 번에 내가 무엇을했는지 기억하지 못합니다.

all: 
    mailer: 
    class: sfMailer 
    param: 
     logging:   %SF_LOGGING_ENABLED% 
     charset:   %SF_CHARSET% 
     delivery_strategy: realtime 
     transport: 
     class: Swift_SmtpTransport 
     param: 
      host:  localhost 
      port:  25 
      encryption: ~ 
      username: ~ 
      password: ~ 

참고 : 여기에

내 응용 프로그램/설정/factories.yml 파일의 내용의 조각입니다 위의 indentaion 인해이 콘솔에 붙여되기 잘못 될 수있다 -면을 얻을하지 않습니다 그것으로 추적했다. 내 컴퓨터에서 YML이 정상입니다.

I 이메일 보내려고 할 때이 기록 된 오류 메시지입니다 :

[19-Feb-2011 14:50:13] PHP 20. userActions->executeRegisterComplete() /lib/vendor/symfony/symfony-1.3.8/lib/action/sfActions.class.php:60 
[19-Feb-2011 14:50:13] PHP 21. sfMailer->send() /path/to/actions.class.php:355 
[19-Feb-2011 14:50:13] PHP 22. Swift_Mailer->send() /lib/vendor/symfony/symfony-1.3.8/lib/mailer/sfMailer.class.php:300 
[19-Feb-2011 14:50:13] PHP 23. Swift_Transport_AbstractSmtpTransport->start() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Mailer.php:74 
[19-Feb-2011 14:50:13] PHP 24. Swift_Transport_StreamBuffer->initialize() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php:101 
[19-Feb-2011 14:50:13] PHP 25. Swift_Transport_StreamBuffer->_establishSocketConnection() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:70 
[19-Feb-2011 14:50:13] PHP 26. fsockopen() /lib/vendor/symfony/symfony-1.3.8/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:233 
[19-Feb-2011 14:50:13] Connection could not be established with host localhost [Connection refused #111] 
+3

컴퓨터에 포트 25에서 수신 대기하는 메일 서버를 설치/구성하는 것과 관련된 수정 사항을 기억하십니까? 문제가있는 것처럼 보이기 때문에 그 순간에 듣고있는 사람이 없다는 것입니다 ... –

+0

그게 내 대답이었을 수도 있습니다. 후위를 설치하고 다른 시도하십시오. – terrid25

답변

1

문제는 당신이 개발 환경에서 보낸 메일을 사용할 필요가 없습니다 수 있습니다.

  • disable_delivery을 : 당신은 설정해야

    imports: 
        - { resource: config.yml } 
    
    framework: 
        router: { resource: "%kernel.root_dir%/config/routing_dev.yml" } 
        profiler: { only_exceptions: false } 
    
    web_profiler: 
        toolbar: true 
        intercept_redirects: true 
    
    monolog: 
        handlers: 
         main: 
          type: stream 
          path: %kernel.logs_dir%/%kernel.environment%.log 
          level: debug 
         firephp: 
          type: firephp 
          level: info 
    
    assetic: 
        use_controller: true 
    
    swiftmailer: 
        disable_delivery: true 
    

    을 :이처럼 config_dev.yml을 완료해야 진정한 (이메일을 보낼 수 없습니다)

  • intercept_redirects을 : 사실 (디버그 바에서 이메일을보고 싶다면
+0

당신은 sf1.0을 사용하고있는 sf2.0에 대해 말하고 있습니다. – j0k

5

나는 항상 같이 있고 항상 일했다; 간단히 localhost smtp 서비스를 사용하지 않습니다.

all: 
    mailer: 
    param: 
     transport: 
     class: Swift_SmtpTransport 
     param: 
      host:  smtp.gmail.com 
      port:  465 
      encryption: ssl 
      username: "[email protected]" 
      password: xxx-password 
+0

은 암호화/포트를 추가해야만'Mailjet ' – Oliboy50

0

내 호스팅 제공 업체에서 동일한 오류가 발생했습니다. factories.yml 들여 쓰기를 편집하여 문제를 해결했습니다. 또한 사용자 이름/비밀번호 값을 확인하십시오.

관련 문제