Totochu Posted May 23, 2021 Posted May 23, 2021 Hi everybody, I'm trying to get an email body with outlookex.au3: _OL_ItemFind($oOL, $mailboxName, $olMail, "", "", "", "Body") It is working great, but as I use the result in a notepad, all the pictures are replaced by links. How can I get the body without any picture? The email is in HTML format. I tried to find a way to convert the email in Text format before getting the body but I couldn't. Is there another way to do it? Thanks a lot for any help! Totochu
water Posted May 23, 2021 Posted May 23, 2021 (edited) Welcome to Autoit and the forum! You could use a Regular Expression to remove the Links. Please have a look at StringRegExpReplace. Edited May 23, 2021 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Totochu Posted May 23, 2021 Author Posted May 23, 2021 Hi Water, thanks for your reply and your welcome! I've checked StringRegExpReplace which is a great function. But here the problem: if I have "normal" links in my email? How can I know which link is part of the body and which one is from a picture? They look the same. The bad thing is when you have a signature with loads of picture, you will get loads of long links instead. So maybe just a function to get the body without signature? Thanks! Totochu
JockoDundee Posted May 24, 2021 Posted May 24, 2021 <img src="some_image.jpg"> Can’t you just filter out img tags? Code hard, but don’t hard code...
water Posted May 24, 2021 Posted May 24, 2021 10 hours ago, Totochu said: So maybe just a function to get the body without signature? A signature is just a part of the body. There is no way determine where the body text ends and the signature starts. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now