1
안녕하세요 저는 젠드 프레임 워크에서 템플릿을 사용하여 magento로 이메일을 보내려고했습니다. 지금까지 나는 하나의 이메일을 가지고 있지 않다. 여기에 내가 가진 것이있다.Magento에서 템플릿없이 메일 보내기
define('MAGENTO', realpath(dirname(__FILE__)));
$new_stock_csv ="var/import/test.co/new_stock.csv";
require_once MAGENTO . '/app/Mage.php';
$currentStore = Mage::app()->getStore()->getId();
$mess = "Test of message to be in body."
product_change_email($mess,MAGENTO.$new_stock_csv);
function product_change_email($mess,$file){
$fromEmail = "[email protected]";
$fromName = "PRODUCT ALERTS";
$toEmail = "[email protected]";
$toName = "Jeremy Bass";
$body = $mess;
// body text
$subject = "Test Subject";
// subject text
try{
$mail = new Zend_Mail();
$mail->setFrom($fromEmail, $fromName);
$mail->addTo($toEmail, $toName);
$mail->setSubject($subject);
$mail->setBodyHtml($body); // here u also use setBodyText options.
// this is for to set the file format
$at = new Zend_Mime_Part($body);
$at->type = 'application/csv'; // if u have PDF then it would like -> 'application/pdf'
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_8BIT;
$at->filename = $file;
$mail->addAttachment($at);
$mail->send();
}catch(Exception $e){
echo $e->getMassage();
}
}
'지금까지 이메일이 하나도 없습니다.'- 무엇을 의미합니까? Magento/Apache/Postfix 오류 로그의 내용은 무엇입니까? –
로그에 아무런 메시지도 표시되지 않고 아무 것도 울리지 않습니다. Magento는 내부 이메일을 보내지 만이 기능을 사용할 수없는 것 같습니다. 감사합니다 - –
어떤 운영 체제에서이 스크립트를 실행하고 있습니까? PostFix를 올바르게 설치하고 구성 했습니까? 내부 이메일이란 무엇입니까? –