AlpVir Well-Known Member Licensed User Longtime User Jun 22, 2015 #1 How to send an email that contains the HTML code ? Code: Copy Dim Message As Email Message.To.Add("[email protected]") Message.Subject = "Test html" Message.Body = "<table><tr><td>Test <b>one</b></td></tr></table>" Message.GetHtmlIntent StartActivity(Message.GetHtmlIntent) Despite numerous tests I have not achieved my goal. Thanks in advance
How to send an email that contains the HTML code ? Code: Copy Dim Message As Email Message.To.Add("[email protected]") Message.Subject = "Test html" Message.Body = "<table><tr><td>Test <b>one</b></td></tr></table>" Message.GetHtmlIntent StartActivity(Message.GetHtmlIntent) Despite numerous tests I have not achieved my goal. Thanks in advance
NJDude Expert Licensed User Longtime User Jun 22, 2015 #2 If you look above, under SIMILAR THREADS, you will find several posts addressing this issue. Upvote 0
AlpVir Well-Known Member Licensed User Longtime User Jun 22, 2015 #3 Thanks but I have read many posts on this topic but I could not finish anything. For this reason that I ask for help. Upvote 0
Thanks but I have read many posts on this topic but I could not finish anything. For this reason that I ask for help.
S sorex Expert Licensed User Longtime User Jun 22, 2015 #4 you are missing the html & body tags to start with. not sure what else is needed to force it into html mode on android tho. Upvote 0
you are missing the html & body tags to start with. not sure what else is needed to force it into html mode on android tho.
Erel B4X founder Staff member Licensed User Longtime User Jun 22, 2015 #5 Your code is correct (though you are calling GetHtmlIntent twice for some reason). Try it with a simple html: <b>Hello</b> world. Upvote 0
Your code is correct (though you are calling GetHtmlIntent twice for some reason). Try it with a simple html: <b>Hello</b> world.
AlpVir Well-Known Member Licensed User Longtime User Jun 22, 2015 #6 After eliminating the double GetHtmlIntent the simple example <b> Hello </ b> works. But it does not work with the tags table. This is very serious for me. Code: Copy Message.Body = "<table><tr><td><b>Hello</b></td></tr><tr><td>no bold</td></tr></table>" Either by entering the tag <HTML> and <BODY> or <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> or <!DOCTYPE html> .... The use of the tables is essential for me. Upvote 0
After eliminating the double GetHtmlIntent the simple example <b> Hello </ b> works. But it does not work with the tags table. This is very serious for me. Code: Copy Message.Body = "<table><tr><td><b>Hello</b></td></tr><tr><td>no bold</td></tr></table>" Either by entering the tag <HTML> and <BODY> or <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'> or <!DOCTYPE html> .... The use of the tables is essential for me.
Erel B4X founder Staff member Licensed User Longtime User Jun 23, 2015 #7 If you check the raw message received in your mail client you will see that the html is sent as is. Maybe your mail client doesn't support tables. Upvote 0
If you check the raw message received in your mail client you will see that the html is sent as is. Maybe your mail client doesn't support tables.
AlpVir Well-Known Member Licensed User Longtime User Jun 23, 2015 #8 I do not know how to read the message in raw format. I have read many post, according to which the <TABLE> tag is not processed by the email client. It seems that it only supported the <B> and <BR> Having the need to send emails with formatted text I also thought of sending a single image that shows the screenshot of a table. But even this seems to work. Code: Copy Message.Body="<html><body><img src=" & Chr(34) & "file://" & File.DirAssets & "/Classe.png" & Chr(34) & "></body></html>" How to fix it (formatted text only)? Upvote 0
I do not know how to read the message in raw format. I have read many post, according to which the <TABLE> tag is not processed by the email client. It seems that it only supported the <B> and <BR> Having the need to send emails with formatted text I also thought of sending a single image that shows the screenshot of a table. But even this seems to work. Code: Copy Message.Body="<html><body><img src=" & Chr(34) & "file://" & File.DirAssets & "/Classe.png" & Chr(34) & "></body></html>" How to fix it (formatted text only)?
S sorex Expert Licensed User Longtime User Jun 23, 2015 #9 and how will people see the image that is on your phone? Upvote 0
AlpVir Well-Known Member Licensed User Longtime User Jun 23, 2015 #10 The image is created from the app by reading a db and is inserted in an email. I attach an example that could be accomplished with a table. Since it seems that the tables can not be sent with an email I thought it could conversely be sent image. I would not use attachments. With a table (<TABLE><TR> .......) would be much simpler ! Upvote 0
The image is created from the app by reading a db and is inserted in an email. I attach an example that could be accomplished with a table. Since it seems that the tables can not be sent with an email I thought it could conversely be sent image. I would not use attachments. With a table (<TABLE><TR> .......) would be much simpler !
DonManfred Expert Licensed User Longtime User Jun 23, 2015 #11 Store the images on your server and inside your html code you load the image from the absolute url on your server. Upvote 0
Store the images on your server and inside your html code you load the image from the absolute url on your server.
S sorex Expert Licensed User Longtime User Jun 23, 2015 #12 or use a php script that send the mail after you posted your mail content to it. disadvantage is you need to be online. Upvote 0
or use a php script that send the mail after you posted your mail content to it. disadvantage is you need to be online.
AlpVir Well-Known Member Licensed User Longtime User Jun 23, 2015 #13 There is no server on which to store the image. The image created on the fly from the app, should be sent via email. It 's really impossible to send an email with the text (body) in HTML (<TABLE> <TR>, etc.) ? Upvote 0
There is no server on which to store the image. The image created on the fly from the app, should be sent via email. It 's really impossible to send an email with the text (body) in HTML (<TABLE> <TR>, etc.) ?
S sorex Expert Licensed User Longtime User Jun 23, 2015 #14 it shouldn't be, it's just text. I'll see if I can test this here. Upvote 0
AlpVir Well-Known Member Licensed User Longtime User Jun 23, 2015 #15 Thank you. I repeat: in Message.body you can insert tags such as <TABLE> or <TR>. They are ignored; this is what I could understand / experience so far I use Android 2.3.3 Upvote 0
Thank you. I repeat: in Message.body you can insert tags such as <TABLE> or <TR>. They are ignored; this is what I could understand / experience so far I use Android 2.3.3
S sorex Expert Licensed User Longtime User Jun 23, 2015 #16 will check at home, Win8.1 on my new desktop at work doesn't recognize my phone. Upvote 0
P Picena Informatica Active Member Licensed User Longtime User Jun 23, 2015 #17 Code: Copy message.htmlbody=true Upvote 0
S sorex Expert Licensed User Longtime User Jun 23, 2015 #18 ok, now I see what you are trying to do. I think you're better of by sending the mail via an smtp server, I thought you were trying to do that already. Upvote 0
ok, now I see what you are trying to do. I think you're better of by sending the mail via an smtp server, I thought you were trying to do that already.
AlpVir Well-Known Member Licensed User Longtime User Jun 23, 2015 #19 @picenainformatica The Email object has no property HTMLBody. The object SMTP instead have it. I, however, I have to use an object Email. Upvote 0
@picenainformatica The Email object has no property HTMLBody. The object SMTP instead have it. I, however, I have to use an object Email.
S sorex Expert Licensed User Longtime User Jun 23, 2015 #20 the problem is that the mail client vary from device to device so it's not certain that it will always work. Upvote 0
the problem is that the mail client vary from device to device so it's not certain that it will always work.