From 5449200972dbd4ace7cc6157aa5a0868e1b18281 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 19 Aug 2014 17:36:38 -0700 Subject: [PATCH] Send SMTP mail using quoted-printable encoding in all cases Summary: See D10278. This works around a bug (?) in SendGrid, see http://stackoverflow.com/questions/6276181/extra-newlines-in-plain-text-emails-sent-via-sendgrid Test Plan: @nickz confirmed this resolved his issue. See also D10278. Reviewers: nickz, btrahan, chad Reviewed By: chad Subscribers: nickz, epriestley Differential Revision: https://secure.phabricator.com/D10303 --- .../PhabricatorMailImplementationPHPMailerAdapter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php index 01e4eeb7a0..32f152f8ff 100644 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php @@ -13,6 +13,11 @@ final class PhabricatorMailImplementationPHPMailerAdapter $this->mailer = new PHPMailer($use_exceptions = true); $this->mailer->CharSet = 'utf-8'; + // NOTE: This works around what seems to be a bug in SendGrid, see + // D10278. This affects other SMTP mailers too, but as long as they + // don't have an opposite bug to SendGrid's bug that should be OK. + $this->mailer->Encoding = 'quoted-printable'; + // By default, PHPMailer sends one mail per recipient. We handle // multiplexing higher in the stack, so tell it to send mail exactly // like we ask.