Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #16871: Email notifications are sent with extra blank lines

This at least happened when sending emails through sendgrid.net smtp gateway.  The fix is to set the encoding and line ending properties.
  • Loading branch information...
commit 2b53936f48727b140c5d009a104e95c67fade0e1 1 parent 8c4e3df
@vboctor authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/email_api.php
View
4 core/email_api.php
@@ -969,6 +969,10 @@ function email_send( $p_email_data ) {
$mail->AddCustomHeader('Auto-Submitted:auto-generated');
$mail->AddCustomHeader('X-Auto-Response-Suppress: All');
+ // Setup new line and encoding to avoid extra new lines with some smtp gateways like sendgrid.net
+ $mail->LE = "\r\n";
+ $mail->Encoding = "quoted-printable";
+
if( OFF !== $t_debug_email ) {
$t_message = 'To: ' . $t_recipient . "\n\n" . $t_message;
$t_recipient = $t_debug_email;
Please sign in to comment.
Something went wrong with that request. Please try again.