schnellste Weg, um Mails mit phpmailer smtp zu versenden?
Ich benutze die folgende phpmailer-Funktion, um mehr als 1000 Mails zu verschicken
<?php
function sendMail($sendTo,$Subject,$Body){
require_once 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'smtp.example.com;smtp.example.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'password';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->From = '[email protected]';
$mail->FromName = 'xyz';
$mail->WordWrap = 50;
$mail->isHTML(true);
$mail->addAddress($sendTo);
$mail->Subject = $Subject;
$mail->Body = ( stripslashes( $Body ) );
$mail->AltBody = 'Please Use a Html email Client To view This Message!!';
if(!$mail->send()) {
$return = 'Message could not be sent.';
// echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
$return = 'Message has been sent!';
}
return $return;
}
und das ist der Code, den ich benutze, um die Funktion aufzurufen
foreach ($emails as $email) {
$subject = "sample subject";
$body = "sample body";
sendMail($email, $subject, $body);
}
size of $ emails array is 1000+ Gibt es eine schnellere und bessere Möglichkeit, dies zu tun?