How to download specific attachment from Outlook mail or rather from any mail.. If i have 2-3 different attachments in one mail like .xlsx, .pdf, .doc

If i have an email which has 2-3 different attachment like .xlsx, .pdf, .doc and if i want to download only specific attachment like the one with .pdf.

How can i do that ??

hi @Harshad_Jadhav

  1. Loop the attachments
  2. Check the condition it has pdf
  3. Then save the file

@Harshad_Jadhav use ForEach item in MailMessage and use if condition as follow

                             If item.Attachments.Tostring.Contains(“pdf”) 

{

//downlaod pdf
}

1 Like