Call-back function returning garbage in result.recipients and result.subject #157
jawilson104
started this conversation in
General
Replies: 1 comment
-
This is normal and not need to open the issue here. You can post in discussions instead. It's described here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Build tool used:
Board used (ESP32/ESP8266/Arudino):
Other Libraries That are used:
Description of problem:
When using the library for sending an email. The call back function returns garbage for result.recipients and result.subject. Need to know if this is normal. I really love the new version of your library. First version was great; this one is better.
Share code snippet to reproduce the issue:
/* This function sends an email message. textMsg is the body
/
bool EmailMsg(String textMsg) {
//Set success flag true
bool MsgSuccess = true;
//Clear all recipients
message.clearRecipients();
message.clearCc();
message.clearBcc();
//Send raw text message
message.addRecipient("PCARS", Recipent_emailStr);
message.text.content = textMsg.c_str();
message.text.charSet = "us-ascii";
message.text.transfer_encoding = Content_Transfer_Encoding::enc_7bit;
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;
// Set the custom message header
//message.addHeader("Message-ID: [email protected]");
//***************************
// Feed the button process switch status-Make sure that
// sending email will not allow a door switch to be missed
SwDoor.read();
//****************************
// Connect to server with the session config
if (!smtp.connect(&session)){
Serial.println("Connection Failure, " + smtp.errorReason());
MsgSuccess = false;
return MsgSuccess;}
// Start sending Email and close the session
if (!MailClient.sendMail(&smtp, &message)){
Serial.println("Error sending Email, " + smtp.errorReason());
MsgSuccess=false;}
return MsgSuccess;
}
/* This funtions handles errors and messages that are
*/
void smtpCallback(SMTP_Status status){
// Print the current status
Serial.println(status.info());
// Print the sending result
if (status.success()){
Serial.println("----------------");
ESP_MAIL_PRINTF("Message sent success: %d\n", status.completedCount());
ESP_MAIL_PRINTF("Message sent failled: %d\n", status.failedCount());
Serial.println("----------------\n");
struct tm dt;
}
}
Beta Was this translation helpful? Give feedback.
All reactions