ESP_Mail_Client text to phone problem with FRM and SUBJ

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());

I've tried changing the encoding to 7bit 8bit and base64

I ran into the same issue. is it an at&t number by chance? i didn't see the issue sending to a tmobile number or to regular email accounts. I wonder if it has something to do with the charSet line? did you find a solution?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.