如何修复向不同的人发送不同的电子邮件 PHPMailer
How to fix send different emails to different people PHPMailer
我将向不同的人发送不同的电子邮件。
第一封邮件发送正常,但第二封邮件等待 180 秒,然后开始发送。我找不到任何默认设置。一旦发送了一封电子邮件,其他人就会去 POOLING 并失败。
我有不同的身体和不同的主题。
代码 1:
sendEmail(false, $email, $message, $subject, $dep_type);
sendEmail(true, $email, $message_client, $subject_client);
发送电子邮件功能:
function sendEmail($client, $email, $message, $subject, $dep_type = null)
{
$from_mail = 'hello@example.com';
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = 'email-smtp.us-east-1.amazonaws.com';
$mail->SMTPAuth = true;
$mail->Username = 'username';
$mail->Password = 'password';
$mail->From = $from_mail;
$mail->FromName = "SenderName";
if ($client) {
$mail->addAddress($email);
} else {
$mail->addAddress('welcome@example.com');
}
$mail->addReplyTo($from_mail, 'name');
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->send();
}
https://aws.amazon.com/de/premiumsupport/knowledge-center/ec2-port-25-throttle/
Amazon EC2 throttles traffic on port 25 of all EC2 instances by
default, but you can request for this throttle to be removed.
我将向不同的人发送不同的电子邮件。 第一封邮件发送正常,但第二封邮件等待 180 秒,然后开始发送。我找不到任何默认设置。一旦发送了一封电子邮件,其他人就会去 POOLING 并失败。
我有不同的身体和不同的主题。
代码 1:
sendEmail(false, $email, $message, $subject, $dep_type);
sendEmail(true, $email, $message_client, $subject_client);
发送电子邮件功能:
function sendEmail($client, $email, $message, $subject, $dep_type = null)
{
$from_mail = 'hello@example.com';
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = 'email-smtp.us-east-1.amazonaws.com';
$mail->SMTPAuth = true;
$mail->Username = 'username';
$mail->Password = 'password';
$mail->From = $from_mail;
$mail->FromName = "SenderName";
if ($client) {
$mail->addAddress($email);
} else {
$mail->addAddress('welcome@example.com');
}
$mail->addReplyTo($from_mail, 'name');
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
$mail->send();
}
https://aws.amazon.com/de/premiumsupport/knowledge-center/ec2-port-25-throttle/
Amazon EC2 throttles traffic on port 25 of all EC2 instances by default, but you can request for this throttle to be removed.