View email message

Post your Gambas programming questions here.
Post Reply
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

View email message

Post 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?
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post 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!
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: View email message

Post 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
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
Quincunxian
Posts: 171
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: View email message

Post 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
Cheers - Quin.
I code therefore I am
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post 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.
bill-lancaster
Posts: 190
Joined: Tuesday 26th September 2017 3:17pm
Location: NW England

Re: View email message

Post by bill-lancaster »

Thanks quin, that's a good idea
Post Reply