View email message

Post Reply
bill-lancaster
Posts: 94
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

View email message

Post by bill-lancaster » Sunday 24th May 2020 4:30pm

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?

bill-lancaster
Posts: 94
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post by bill-lancaster » Monday 25th May 2020 8:47am

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!

vuott
Posts: 37
Joined: Wednesday 05th April 2017 6:07pm

Re: View email message

Post by vuott » Monday 25th May 2020 3:06pm

bill-lancaster wrote:
Monday 25th May 2020 8:47am
Also 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

User avatar
Quincunxian
Posts: 89
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: View email message

Post by Quincunxian » Monday 25th May 2020 10:10pm

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
Cheers - Quin.
I code therefore I am

bill-lancaster
Posts: 94
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post by bill-lancaster » Tuesday 26th May 2020 8:22am

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.

bill-lancaster
Posts: 94
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post by bill-lancaster » Tuesday 26th May 2020 8:24am

Thanks quin, that's a good idea

Post Reply