M mindful Active Member Licensed User Nov 30, 2017 #1 Hello everybody, is it possible to send an email containing both text and html using the SMTP class from jNet library ? SMTP.HtmlBody is just a switch that sets the body either text or html. I want to send the email in html format but for those recipients whos email client has html format disabled i want them to see the text version.
Hello everybody, is it possible to send an email containing both text and html using the SMTP class from jNet library ? SMTP.HtmlBody is just a switch that sets the body either text or html. I want to send the email in html format but for those recipients whos email client has html format disabled i want them to see the text version.
Erel B4X founder Staff member Licensed User Longtime User Nov 30, 2017 #2 It is possible but you will need to build the mail structure yourself. You can see an example of creating a mail message in MailCreator class: https://www.b4x.com/android/forum/threads/b4x-sending-emails-with-gmail-rest-api.81736/#content In your case you need to create two parts. One with text/html and one with text/plain. You can then send it as a plain text message and set the Content-Type header manually in the AdditionalHeaders map. Upvote 0
It is possible but you will need to build the mail structure yourself. You can see an example of creating a mail message in MailCreator class: https://www.b4x.com/android/forum/threads/b4x-sending-emails-with-gmail-rest-api.81736/#content In your case you need to create two parts. One with text/html and one with text/plain. You can then send it as a plain text message and set the Content-Type header manually in the AdditionalHeaders map.