I am having an issue when the text is sent to the phone the FRM is FRM:=?utf-8?B?RHJhaW4gQWxlcnQ=?= and the SUBJ is "SUBJ:=?utf-8?B?RFJBSU4gUEF.... but the MSG is coming back just fine. Using a Gmail for SMTP and the carrier is AT&T.
//SETUP MAIL SESSION
ESP_Mail_Session session;
session.server.host_name = SMTP_HOST;
session.server.port = SMTP_PORT;
session.login.email = AUTHOR_EMAIL;
session.login.password = AUTHOR_PASSWORD;
//SETUP MAIL MESSAGE
SMTP_Message message;
message.sender.name = "Drain Alert";
message.sender.email = AUTHOR_EMAIL;
message.subject = "DRAIN PAN ALERT";
message.addRecipient("", myEmail);
//SEND HTML MESSAGE
debug("Sending message to ");
debugln(myEmail);
String htmlMsg = "<div style=\"color:#2f4468;\"><h1>DRAIN ALERT</h1><p> drain pan is full </p></div>";
message.html.content = htmlMsg.c_str();
message.html.content = htmlMsg.c_str();
message.text.charSet = "us-ascii";
message.html.transfer_encoding = Content_Transfer_Encoding::enc_8bit;
//SEND RAW TEXT MESSAGE
String carrierAddress = smsGateway[carrier];
String textAddress = myNumber + carrierAddress;
debug("Sending text to: ");
debugln(textAddress);
message.addRecipient("", textAddress);
String textMsg = "Drain having issue";
message.text.content = textMsg.c_str();
message.text.charSet = "us-ascii";
message.text.transfer_encoding = Content_Transfer_Encoding::enc_8bit;
message.priority = esp_mail_smtp_priority::esp_mail_smtp_priority_low;
message.response.notify = esp_mail_smtp_notify_success | esp_mail_smtp_notify_failure | esp_mail_smtp_notify_delay;
if (!smtp.connect(&session))
return;
if (!MailClient.sendMail(&smtp, &message))
debugln("Error sending Email, " + smtp.errorReason());