The SMTPMailSystem plugin incorrectly extracts email addresses from the "From" and "Return-Path" headers when they are formatted as (without a display name). The preg_match() regex requires a mandatory space before the email, which leads to extraction failures.
- Configure SMTPMailSystem to send an email where the From address is in the format (without a display name).
- Attempt to send an email.
- Observe that PHPMailer may fail to process the email, or it may be rejected by some mail servers.
- Modify the regex in SMTPMailSystem.php to correctly extract the email address when there is no display name.
- Ensure that the Return-Path header also correctly extracts just the email.
- Apply trim() to prevent issues with leading/trailing spaces.
Active
1.4
Code