2010-07-18 5 views
0

SwiftMail 또는 유사한 시스템을 사용하여 배치 메일을 보내고 싶습니다.배치 이메일은 다음 주소로 보내십시오.

"메시지의 각 수신자는받는 사람 : 입력란에 고유 한 이메일 주소 만있는 다른 사본을 수신합니다. 수신자 수를 포함하는 정수가 반환됩니다."라고 SwiftMailer 문서에 설명되어 있습니다.

http://swiftmailer.org/docs/batchsend-method

나는 그것이 실패한 이메일 주소를 알아 가능 여부를 알고 선택적으로 오류 이유/코드를 가져올.

답변

1

는 batchsend에 대해 이야기() 실패 http://swiftmailer.org/docs/finding-failuresexample, 이 있음이 지침에서 다른 페이지가 있고 난 batchsend 정확히 같은 방식으로을 할 것입니다 생각한다.

$mailer = Swift_Mailer::newInstance(...); 

$message = Swift_Message::newInstance(...) 
    ->setFrom(...) 
    ->setTo(array(
    '[email protected]' => 'Receiver Name', 
    '[email protected]' => 'A name', 
    '[email protected]' => 'Other Name' 
)) 
    ->setBody(...) 
    ; 

//Pass a variable name to the send() method 
if (!$mailer->send($message, $failures)) 
{ 
    echo "Failures:"; 
    print_r($failures); 
} 

/* 
Failures: 
Array (
    0 => [email protected], 
    1 => [email protected] 
) 
*/ 
+0

나는 본다. 그래서 실패 이유를 반환 할 수 있다고 생각하지 않습니까? – GSTAR

+0

죄송합니다. –