Matlab function which imports the 'readed' or 'unreaded' outlook emails from inbox and their folders - subfolders.
Extracts their subjects, bodies and can save their attachments.
% Reads all emails from inbox
mails = ReadOutlook;
% Reads all Unread emails from inbox
mails = ReadOutlook('Read', 1);
% Reads all Unread emails from inbox and mark them as read
mails = ReadOutlook('Read', 1, 'Mark', 1);
% Reads all emails from a email folders and save their attachments
mails = ReadOutlook('Folder', 'Groups', 'Savepath', 'C:\matlab\data\test');
Ioannis Kyriakos (2021). Read / Scraping emails from Microsoft Outlook (https://github.com/KyriakosJiannis/Matlab-read-Outlook), GitHub. Retrieved .
i ve tried this:
mails = ReadOutlook('Folder', 'Work','Subfolder', 'XX','Savepath', 'C:\Users\Itali\Documents\MATLAB\github_repo')
and i get this error:
Unrecognized function or variable 'n'.
Error in ReadOutlook (line 98)
folder_numbers = INBOX.Folders(1).Item(n).Folders(1).Count;
Can you help me?
Thank you very much!
Great work! Thank you!
Thanks for this code, I am hoping it will help me get some data from some specific emails. Unfortunately those emails are in a PST file that is saved and then imported to outlook. Is there a way to address a linked PST file rather than the usual inbox?
thanks for the code,
I'm getting operation aborted on the body of the email though
does manage to grab the subject but not quite the body.
I get operation aborted, also in the actxserver connection part
could be a number of reasons
Typo at line 137: should be 'if f.Mark...' instead of 'if Mark...'
I am very happy that you enjoy using this function.
It looks really interesting question, but unfortunately, I have not Outlook+Matlab/Octave on my current machine to play around. I will try to check it during the next weeks.
Meanwhile, I suggest to
1) set a debug point at 162 (line) if UnRead,
2) then, check how the "email" object looks in Matlab, [you may send me a screenshot at email@example.com to have a look too]
3) in case that it is possible, then we have to add after 165 line: body = email.get('Body'); which extracts the email's body, the one that extracts the date (if exist) and modify the output.
I’m really happy to use your code to read emails content.
Could you help me to retrieve the date of the email please?
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!