我在这里有一个代码可以向客户和管理员发送电子邮件。到目前为止它正在发送给客户,但我无法弄清楚为什么它没有发送给管理员请帮忙。
$mail = new PHPMailer();
$mail->IsMail();
$mail->AddAddress($email);
$mail->Subject = $subject;
$mail->IsHTML(true);
$mail->From= $admin_email;
$mail->FromName= "Chinchilla Scientific";
$mail->Body = $user_message;
if(!$mail->Send())
{
echo "Error sending: " . $mail->ErrorInfo;;
}
$mail = new PHPMailer();
$mail->IsMail();
$mail->AddAddress($admin_email);
$mail->Subject = $subject;
$mail->IsHTML(true);
$mail->From = $email;
$mail->FromName= $name;
$mail->Body = $admin_message;
exit;