SMTP Sends All Files Even When One Is Set

Title: SMTP Mail Activity Sends All Attachments Even When Only One File Is Given

Hi community,

I’m working on a project where I download 5 Excel files from email, merge them, and send back just the final report using “Send SMTP Mail Message”.

Problem: Even when I use this code:

finalAttachment = New List(Of String) From {"OUTPUT\Final Report.xlsx"}

…and I use this in the SMTP AttachmentsCollection, it still sends all 6 files, not just one.

:white_check_mark: I’ve already:

  • Reset the SMTP attachment property
  • Deleted and re-added SMTP activity
  • Checked that no attachments variable is being passed
  • Confirmed finalAttachment only contains 1 file

Still, all files are sent.

What else could cause SMTP to reuse attachment lists even when not provided?

Thanks in advance :folded_hands:

Are you sending or forwarding the email ??

Also check whether any of the below have values apart from what you are expected to configure

Firstly, you shouldn’t use partial paths. You also shouldn’t store file used during processing inside the project folder.

Anyway, check if you have any of these variables defined more than once. Put a Log Message activity immediately before the Send SMTP Mail Message activity and have it output String.Join(“;”,finalAttachment) and show us a screenshot of what it gives you.

Hi @AL_AZHIR

Try to re create the mail message object like example : mail = New System.Net.Mail.MailMessage() do test in testing xmal and check