Skip to content

Commit

Permalink
Update PHPMailer to 6.0.6
Browse files Browse the repository at this point in the history
Merge pull request #1410 from dregad/phpmailer6

Fixes #24990
  • Loading branch information
dregad committed Nov 20, 2018
2 parents 156bf3b + c0638b7 commit 8d5524d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 36 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"guzzlehttp/guzzle": "^6.2",
"vboctor/disposable_email_checker": "^3.0",
"adodb/adodb-php": "^5.20",
"phpmailer/phpmailer": "^5.2.22",
"phpmailer/phpmailer": "~6.0",
"erusev/parsedown": "^1.7.0",
"dapphp/securimage": "dev-mantis"
},
Expand Down
55 changes: 22 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions core/email_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
require_api( 'user_pref_api.php' );
require_api( 'utility_api.php' );

use PHPMailer\PHPMailer\PHPMailer;
use Mantis\Exceptions\ClientException;

# reusable object of class SMTP
Expand Down Expand Up @@ -1262,6 +1263,11 @@ function email_send( EmailData $p_email_data ) {
register_shutdown_function( 'email_smtp_close' );
}
$t_mail = new PHPMailer( true );

// Set e-mail addresses validation pattern. The 'html5' setting is
// consistent with the regex defined in email_regex_simple().
PHPMailer::$validator = 'html5';

} else {
$t_mail = $g_phpMailer;
}
Expand Down Expand Up @@ -1332,8 +1338,6 @@ function email_send( EmailData $p_email_data ) {
$t_mail->AddCustomHeader( 'Auto-Submitted:auto-generated' );
$t_mail->AddCustomHeader( 'X-Auto-Response-Suppress: All' );

# Setup new line and encoding to avoid extra new lines with some smtp gateways like sendgrid.net
$t_mail->LE = "\r\n";
$t_mail->Encoding = 'quoted-printable';

if( isset( $t_email_data->metadata['priority'] ) ) {
Expand Down

0 comments on commit 8d5524d

Please sign in to comment.