Page 1 of 1

View email message

Posted: Sunday 24th May 2020 4:30pm
by bill-lancaster
I have a folder of mail message files downloaded from a mail server.
Is there a way of viewing these messages within a gambas project?

Re: View email message

Posted: Monday 25th May 2020 8:47am
by bill-lancaster
I should say that MailClient.Message.Body[0].ToString() does work but doesn't seem to deal with html messages, it show the raw html.
I don't know if Mime.Decode would do the job because I'm struggling with it.
Also MimeMessage is a possibility but haven't figured that one out.
If there's a simpler way to display any message then I'd like to know about it!

Re: View email message

Posted: Monday 25th May 2020 3:06pm
by vuott
bill-lancaster wrote: Monday 25th May 2020 8:47amAlso MimeMessage is a possibility but haven't figured that one out.
Maybe about using "MimeMessage" you could take a look at this wiki page of Italian Gambas Forum:

https://www.gambas-it.org/wiki/index.ph ... _di_Gambas

Re: View email message

Posted: Monday 25th May 2020 10:10pm
by Quincunxian
If the html messages are in raw html - you could pass them to a qt4 webview control then extract the text from that.

webview.url = html-mail-message
text-to-save = webview.text

Re: View email message

Posted: Tuesday 26th May 2020 8:22am
by bill-lancaster
Thanks vuott, the link was usefull in showing how mimemessage works but (so far) does not display messages properly. The example works fine with multipart/mixed type messages but not for other types.

Re: View email message

Posted: Tuesday 26th May 2020 8:24am
by bill-lancaster
Thanks quin, that's a good idea