您正在循环向用户发送电子邮件。将用户电子邮件移出循环,使其只发生一次。
<?php
try {
foreach ($split as $multiemail) {
$mail = new Zend_Mail();
$mail->setBodyText($rq_msg);
$mail->setBodyHtml($rq_msg);
$mail->setFrom($fromEmail, $fromName);
$mail->addTo($multiemail, $adminName);
$mail->setSubject('New request from customer: ' . $fromName);
$mail->send();
}
$mail = new Zend_Mail();
$mail->setBodyText($cust_msg);
$mail->setBodyHtml($cust_msg);
$mail->setFrom('our@email.com');
$mail->addTo($fromEmail);
$mail->setSubject('Your request was received, ' . $fromName);
$mail->send();
}
catch (Exception $e) {
echo $e->getMassage();
}
Mage::getSingleton('core/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
$this->_redirectUrl($request[ 'redirecturl' ]);