-
Hi, I am trying to change the content text of the email for the email I wanted to be sent but it fails on all the way I tried. I would like to modify "text" from the line 'message.text.content = "text" in the program loop section on the press of a button. Is there a command or another way to change it during the program running ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
You can assign Arduino String, string literal, const char* or char array to all options and config that accept string included the SMTP_Message class options like this. SMTP_Message message;
message.text.content = String("This is simple plain text message");
message.text.content = String("This is ") + "simple plain text message";
const char *msg = "This is simple plain text message";
message.text.content = msg;
char text[34] ="This is simple plain text message";
message.text.content = text; And you also can assign the html message part with message.html.content = "<p>some html text message</p>"
message.html.content = String("<div>my html message</div>"); Make sure you understand about the multiparts message in case you include other MIME type contents other than plain/text message. The email app or client received this message should be able to parse these multiparts message. |
Beta Was this translation helpful? Give feedback.
-
When you change the content of |
Beta Was this translation helpful? Give feedback.
-
You should debug your code to find what is wrong with your code. |
Beta Was this translation helpful? Give feedback.
-
Sorry to ask again... Do you know why, after a certain time the mail session connexion seems to be closed. So when the email is trying to send, it goes on error. Is there a way to keep the connexion up /or a way to reconnect to a new session everytime I want to send an email with the trigger ? |
Beta Was this translation helpful? Give feedback.
-
It's depending on server to close connection, or the connection is timed out due to the internet problems. |
Beta Was this translation helpful? Give feedback.
-
The library will close the connection if 40 seconds time out reached. |
Beta Was this translation helpful? Give feedback.
You can assign Arduino String, string literal, const char* or char array to all options and config that accept string included the SMTP_Message class options like this.
And you also can assign the html message part with
Make sure you understand ab…