MantisBT: master-2.25 28c9d1a6

Author Committer Branch Timestamp Parent
dregad dregad master-2.25 2023-04-11 07:00 master-2.25 b5259af0
Affected Issues  0030127: new PHPMailer() is created for every outgoing email
Changeset

Set $g_phpMailer after creating PHPMailer object

Since commit b847c5936ac7579d6bdfaa90ce1c08d1aa874231, the global var
is no longer initialized, causing a new PHPMailer object to be created
with each call to email_send().

When $g_phpMailer_method = PHPMAILER_METHOD_SMTP), depending on the
SMTP server's settings, this could cause a delay when sending mail
(e.g. if more messages are queued than allowed by the server's cooldown
period) and if $g_email_send_using_cronjobjob is OFF, MantisBT could
hang or even timeout.

Fixes 0030127

mod - core/email_api.php Diff File