【发布时间】:2020-07-23 02:25:40
【问题描述】:
我正在创建一个脚本,每天将 10 个文件发送给不同的收件人。这些文件的大小可达 15 MB。 phpmailer 需要花费 10 到 15 分钟的大量时间。所以它对我来说变得无法使用。我正在使用 gmail smtp。
//Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
$mail->SMTPDebug = 0; //Alternative to above constant
$mail->isSMTP(); // Send using SMTP
$mail->Host = 'smtp.gmail.com'; // Set the SMTP server to send through
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'rmudelhi@gmail.com'; // SMTP username
$mail->Password = 'rainfall2016'; // SMTP password
//$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
$mail->SMTPSecure= 'tls';
$mail->Port = 587;
有人可以帮我改进吗?
【问题讨论】:
-
能否请您发布发送电子邮件的代码?
标签: performance email gmail phpmailer attachment