MBF Knowledge Base

When I send email via Gmail using PHPMailer, the email is taking a long time to send. At times, it will not send at all. How do I fix this?

This happens because PHPMailer works with uniqid() to create its boundary strings, which on certain hosts, is very slow. To fix the issue, open the class.phpmailer.php file and find the following line:

$uniq_id = md5(uniqid(time(), true)); // adding 2. param more_entropy (false)

Change (false) to (true).

When setting this to TRUE, uniqid() will add additional entropy (using the combined linear congruential generator) at the end of the return value, which increases the likelihood that the result will be unique.