Zend Framework 1
인라인 이미지 및 첨부 파일이있는 email
을 보내려고합니다.Zend_Mime_Message를 Zend_Mail 본문으로 설정하십시오.
$mail = new Zend_Mail();
$mail->setType(Zend_Mime::MULTIPART_MIXED);
$mail->setSubject('Message');
$mail->setFrom('[email protected]', 'Example user #1');
$mail->addTo('[email protected]', 'Example user #2');
그리고 this example에 의해, nested email
을 만들려고.
message
mainMultipart (content for message, subType="related")
->htmlAndTextBodyPart (bodyPart1 for mainMultipart)
->htmlAndTextMultipart (content for htmlAndTextBodyPart)
->htmlBodyPart (bodyPart1 for htmlAndTextMultipart)
->html (content for htmlBodyPart)
->textBodyPart (bodyPart2 for the htmlAndTextMultipart)
->text (content for textBodyPart)
->fileBodyPart1 (bodyPart2 for the mainMultipart)
->FileDataHandler (content for fileBodyPart1)
작은 예 :
$html = '<p>Hello</p>';
$bodyHtmlPart = new Zend_Mime_Part($html);
$bodyHtmlPart->type = Zend_Mime::TYPE_HTML;
$bodyMsg = new Zend_Mime_Message();
$bodyMsg->addPart($bodyHtmlPart);
// And other nesting.. ending with Zend_Mime_Message
질문 :
어떻게 Zend_Mime_Message
몸 Zend_Mail
에를 설정하는 방법? 아래 커플 추가 Zend_Mail
기능, 정말 도움이되지 않습니다.
$mail->setBodyHtml(?);
$mail->setBodyText(?);
나는
Zend_Mail_Message
기능에 보이지만, 그것은 단지
ZF2
작동 닮았하려고 노력했다. 여기에 인라인 이미지에 대한
문제점 저는 직면하고 있습니다 : 인라인 이미지 첨부 파일 및 첨부 파일이 올바르게 표시되지 않을 수 있습니다. 그래서'multipart MIME 네 스팅 '을하고 있습니다. 답변은 실제로는 질문과 일치하지 않습니다. – Vaidas
잘 대만족 나는 그들이 제대로 표시되지 알고, 내가 어떻게 바나나를 표시하는 방법을 보여 도움이 답을 쓰지 않았다. – alex