[Rejected] SMTP email using 'html' format with Amazon SES
I ran into this issue using the following:
  • Amazon SES SMTP (port 587 with TLS)
  • MyBB 1.8.11
  • Gmail as the receiving email user
Basically, I use the MyBB function my_mail to send mail (from inc/functions.php).

  define('IN_MYBB', 1);
  require "../global.php";
  require_once MYBB_ROOT."inc/functions.php";

  $user_email = "[email protected]";
  $from_email = "[email protected]";
  $email_message = "THIS IS A TEXT MESSAGE";

  $email_message = nl2br($email_message);
  $email_message = wordwrap($email_message, 70);
  $email_subject = "Testing email for new thing";
  //Send using MyBB mail
  my_mail($user_email, $email_subject, $email_message, $from_email, "", "", false, "html");

However, this would not work with Amazon SES SMTP. I tested various other SMTP providers which worked fine (SendGrid, Mailgun, etc).

Now changing the format from 'html' to 'text' or 'both' made it work fine.
I did some digging and discovered MyBB doesn't actually use 'html' format anywhere, only 'text' or 'both'.

I managed to fix this issue by commenting out the following line in: inc/class_mailhandler.php

$this->headers .= "Content-Transfer-Encoding: 8bit{$this->delimiter}{$this->delimiter}";

I'm not sure if this is a MyBB bug or oddity with Amazon SES SMTP.
Just posting here in case anyone else ever runs into this issue.

Messages In This Thread
SMTP email using 'html' format with Amazon SES - by Byte - 2017-06-06, 06:59 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)