This command sends an email with a single file attachment only. You will not be able send multiple attachment at one go.
Command syntax as below.
Email sendMailWithAttachment from to subject body attachment_dir attachment
You may be able to send multiple files by zip them and create a single zip file(myatt.zip) and then specify it against attachment parameter. This may be a workaround.
I would like understand below
what your looking to achieve?
why you need to send multiple attachment?
I'm running some nsh script to export data to a csv file. however, I have multiple csv file created and I will like to have it send out all together at the same time rather than sending it one at a time.
Currently my steps (for individual scripts) are
1) run the nsh script to generate csv file
2) send attachment (after every script run)
I will like to achieve using a batch job:
1) run all the nsh script to generate all the necessary csv files
2) send out the csv files in 1 email
This is also to reduce the number of mail user is receiving.
I will suggest to run all the nsh scripts and generate all the necessary csv files.
then use zip/tar command to create a single attachment. Now specify the zip/tar file name in the command.
you can check this NSH Command to compress directories.
You could compress the files into a single file as Monoj Padhy has mentioned above
Or you could reference an external command line mailer that you put on your application servers
On our Windows application servers we use blat as it allows us to send HTML email which cannot be done with BSA natively, this also supports multiple attachments so you add -attach file1 -attach file2 etc..
I am not sure what the Linux equivalent of blat is mutt ??
Thanks for the link, Blas.
Thanks for the suggestions, Mike.
Ended using blat as my colleague had already it running for another application.
right now the sendmailwithattachments does not support multiple attachments.