A simple script highlighting how you can connect to Outlook and import emails into MATLAB. It allows you to:
Import Subject Text
Import Body Text
Save attachements to the current directory.
David Willingham (2020). READMAIL (https://www.mathworks.com/matlabcentral/fileexchange/33684-readmail), MATLAB Central File Exchange. Retrieved .
It's very useful, which gives Matlab a stronger automation capability.
Dear all, here is the solution to look inside subfolders:
% I’m looking for emails inside this location:
% Boîte de reception -> SubFolder -> SubSubFolder
%% Connecting to Outlook
outlook = actxserver('Outlook.Application');
if(strcmp(mapi.Folders.Item(1).Folders.Item(k).Name,'Boîte de réception'))
Thanks to David and his colleague
I'm tring to read all emails Ilocated inside a specific folder, not in the current one.
Could you help me please?
Can I get the date of the first mail received ? Any command for that ?
@Mohammed Alabiech: I realize I am probably late, but for others wondering:
sender = email.get('SenderName')
Stores the name of the sender as string in variable sender.
I have this error. Any solutions?
Error using Interface.Microsoft_Outlook_15.0_Object_Library._Items/Item
Invoke Error, Dispatch Exception:
Source: Microsoft Outlook
Description: Array index out of bounds.
subject = firstemail.get('Subject');
body = firstemail.get('Body');
what about sender address ??
How I can connect with yahoo mail please...
Exactly what I need ******
Thanks for the submission. Seems to work fine. But unfortunately, only for my default outlook account. I have 3 accounts on Outlook. Do you know how I could access the e-mails on one of my secondary accounts?
I get email from the same person (with the same subject)around the same time everyday. How could I edit your code so that everyday this particular email could be loaded into matlab? Thanks a lot!