How to handle exceptions for mail messages with the no or wrong type of attachment

I have a bot running but I would like to add an exception for when someone sends me an email without attaching a pdf-type document or if they simply don’t send an attachment. I would like to reply to the email stating that they need to attach a pdf. I am currently stuck on how to reply to the email if I don’t know the sender’s email while I am writing the code. Please help and TIA

i think this is the right logic

1 Like

HI,

FYI, the following condition might be better.

currentItem.Attachments.Any(Function(a) System.IO.Path.GetExtension(a.Name).ToLower=".pdf")

Sequence.xaml (9.1 KB)

Regards,

2 Likes

Thank you all for your help! I am getting an error now and I am not sure what the issue is. Any advice?

Hi,

For now, can you tr y to remove “Reply From” proerty because this exception seems related with accountName?

Regards,

1 Like

Yoichi, thanks for that! But now it just sends the email to itself ie. the bot’s email. How do I get it to reply back to the other email?

Yoichi, I figured it out!! I think my issue was that I was forwarding emails to this demo bot’s email from my personal email, so it got sent back to the demo bot’s email. Thanks a lot for all your help!

1 Like