Email Automation Problem

Want to download attachment from gmail
but there was en error of converting mail message by choosing the System.mail.message

There is another problem in IF condition where the mail function are not showing up.
Solution for it ?

1 Like

@hasib08,

Check this link,

Already use this
But the problem is in If condition where we have to mention item.body ? It not showing up see the screenshot attached
@sarathi125

Hello!

Go to for each and change the PROPERTY “Type Argument” from OBject to MailMEssage

image

GIve it a try :wink:

Kind regards,
Daniel

Okay

you were almost done
in For each loop change the type argument property as System.Net.Mail.Mailmessage and inside the loop with IF condition you could now able to see the attachments method with
item.Attachments

Cheers @hasib08

Tell me if it works.

If it works, please mark it as a solution.

Kind regards,
Daniel

@vilardelld @Palaniyappan
Error

You were almost done
Kindly check once with the username password provided with property panel of pop3
And also the port value
Or we got other options to get the mail like IMAP, outlook and exchange
Cheers @hasib08

@Palaniyappan
Done and getting the email attachment
But the problem is with the else condition, message box is coming 8 times
Solution ?

i hope the get imap should have given you 8 number of mails or more than that and among then some of the mail has no subject with that string, so getting into the ELSE part

Cheers @hasib08

Deleted all the emails
now its downloading the file
but after running it second time it does not go into else part

Unreadmessage is checked

is markas read checked if so we wont get those mails in second run as it would have got marked as read
Cheers @hasib08

@Palaniyappan

then we need to check only the subject of the mails buddy
as everything looks perfect
Cheers @hasib08

if not found it should be showing message box
its not coming
Cheers @Palaniyappan