我不知道如何在以下编码中添加抄送或密件抄送..我尝试了密件抄送,但邮件无法发送。请有人帮忙!...
代码是
$data = array('name' => $username, 'to_user_id' => $to_userid, 'email' => $email, 'telephone' => $telephone, 'title' => $title, 'ip' => $ip, 'message' => $message);
$templateId =1;
$sender = Array('name' => "Admin", 'email' => "[email protected] /cdn-cgi/l/email-protection");
$useremail = $product_user;
$emailName = $username;
$vars = array('username' => $username, 'telephone' => $telephone, 'mail_id' => $email, 'title' => $title, 'message' => $message, 'object' => $this);
$storeId = Mage::app()->getStore()->getId();
$mailSubject = 'mail check';
$translate = Mage::getSingleton('core/translate');
$translate->setTranslateInline(false);
Mage::getModel('core/email_template')
->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
->setTemplateSubject($mailSubject)
->setBcc('[email protected] /cdn-cgi/l/email-protection')
->sendTransactional($templateId, $sender, $useremail, $emailName, $vars, $storeId);
$translate->setTranslateInline(true);
$model = Mage::getModel("contacts/contacts")->setData($data)->save();
Mage::getSingleton("core/session")->addSuccess("You have been successfully sent your mail..");
$this->_redirectReferer();
return;
您可以使用addBcc('[email protected] /cdn-cgi/l/email-protection')
代替setBcc('[email protected] /cdn-cgi/l/email-protection')
在您的代码中或像这样修改您的代码
//mail transaction
$mail = Mage::getModel('core/email_template');
$mail->getMail()->addCc('[email protected] /cdn-cgi/l/email-protection');
$mail->addBcc('[email protected] /cdn-cgi/l/email-protection')
->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
->setTemplateSubject($mailSubject)
->sendTransactional($templateId, $sender, $useremail, $emailName, $vars, $storeId);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)