PHPMailer using Gmail SMTP slow when sending emails

后端 未结 6 1581
礼貌的吻别
礼貌的吻别 2020-12-30 14:17

I found few older threads that have a similar issue but most of them didn\'t have answers or if they had, the suggestions weren\'t relevant in my case.

I had a compl

6条回答
  •  心在旅途
    2020-12-30 14:57

    One of solutions to remove waiting from client to server is to move sending emails to crontab. So when client clicks for sending, php adds email and message to queue, and then every minute you send queued messages by cron.

    In addition you can add debug info into your script by having $start = microtime(true); at the top of the script and echoing echo "Line ".__LINE__.":"round(microtime(true) - $start, 3)."sec
    ";
    at every line.

提交回复
热议问题