Extract Internet Header from an email

Does anyone know how to extract Internet Header from Inbox emails using UI Path?

Hi @tustighosh

Check with this thread.

Regards

Thanks much Pravin_calvin. I tried the last bit - but its showing error for me in covertit value - i am not sure how to do it actually, do you have a sample or will you be able to explain step by step what he has tried. I am bit new to it. Thanks!

@tustighosh

which type of mail activity you’re using?

Regards

Hi! I am trying to create a phishing header check for the outlook emails. So was planning to extract the internet header of each email and evaluate it using the online tool. The problem is i am unable to extract it. As per the other forum discussion solution - i used the invoke code inside the for loop of the outlook email activity. but the argument arraignment (as shown) is throwing an error. Thanks!

Hi @tustighosh

TBH I have never tried this before.

You may ping @loginerror @Palaniyappan @ppr @Yoichi @ermanoj3101 @kumar.varun2
@prasath17

Regards

Thanks no problem :slight_smile:

@c.ciprian Hello! i was trying to do the similar thing. When i tried doing what you have put it as solution, its failing for me in the argument value bit. I was hoping if you could kindly talk me through the actual steps, i will be grateful. Thanks in anticipation.

@tustighosh
After some RND

It is working as described by

grafik

Import Namespace:
grafik

close XAMl in UiPath Studio
Take a bckaup
Open XAML in a text editor. e.g notepad++

Add Following:


<AssemblyReference>Microsoft.Office.Interop.Outlook</AssemblyReference>

Save and reopen it in UiPath

1 Like

@ppr Thanks much, yet to try. Will update for sure :slight_smile:

@ppr I gave it a try last night as per your suggested steps but i think i am missing something or it may be the link issue as i cant access the link in the code. attaching is the screen shot. I am sorry i am pretty new to this, hence please excuse my ignorance. Any help would be appreciated. thanks!

find starter help here:
OTLK_GetInternetHeaders.xaml (6.9 KB)

please change Mailfolder setting as i was forced to use my geman name

You are great, thanks! @ppr
,but sorry to inform when i opened attached file its showing me following error - I even changed the variable to MSoffice.interop.outlook.mailitem - but still it throws the error - propertyaccessor is not a member of UIpath.core.unknowntype at line 2. And i did point towards my mailbox. am i missing any package?

was mentioned above on what to do

Thanks for your response, Its there already. I had opened you solution only.

office
Microsoft.Office.Interop.Outlook
BalaReva.Excel

What is myMM variable type you have used and in which activity?
What is the mi argument variable type - because thats also unknown?
And what is the missing or invalid activity ?
Adding outlook mailitem as variable type to both the unknown variable types and even after removing that missing activity - it fails in the code.

[RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object.
at UiPathCodeRunner_da28929385e843b993e1cd051607e323.Run(MailItem mi,
String& myHeader)]

there is adifference betwen your screenshot and my xaml

grafik

it is missing the Alphabet Get Outlook Mail item of Message Activity

I reattached the XAML here:
OTLK_GetInternetHeaders.xaml (6.9 KB)

1 Like

Yes thats what i was trying to tell last time itself- i think i dont have that functionality when i open your file in my system -
image

And i tried searching - there is no such activity as alphabet get … in my UI path 2021.4.4

I think i got the package and installed. now it shows the activity - lemme run it. :slight_smile:

@ppr Oh thank you, the page didnt get refresh but anyway i found the package and it worked. yeay!! If you dont mind - i would like to understand the technicality as well- so what this alphabet workflow activity is doing actually and how its different from any assign activity inside a if loop (assuming its holding each mail-item ) ? The header is mainly fetch by the .net invoke code bit (correct me if i am wrong) ?

I did try the header through the DMARC tool check - the email failed for SPF - which its not supposed to. :smiley: need to validate the header text now i guess whether its fetching correctly. Thanks much for your help and patience. Hope to hear your explanation for above.

@tustighosh
Lets do one thing and seperate Case/Solution from Explaination purpose. This helps other members easier to find the working solution when they are searching for the similar case.
So once you have done with your testing please mark the solving post as solution. Thanks

For:

I would suggest to get in touch with Markus Werner via forum or Marketplace, as he is the author from the Custom Activity / nuget package