I am having many files to be attached and send them via email. I am running script to do so. Can you help me with code ?
Select all of the files that you wish to send via email and copy them to a new folder. Now, right click on the folder and then select Send to. Selecting this will give you multiple options, look for the one that says Compressed (zipped) folder. Select this option and it will convert your folder into a zipped file.
Use mailx: The only problem is gathering the attachments with the -a option for the mailx command. This can also be done with the mutt command (note that its flags are different). To run this every XXX time units you can create a cron job.
When you open the folder where the files are stored, select one and then press and hold the Ctrl Key down while you click each file you want to attach. When you are finished click the Open Button and all of the selected files will be attached.
You can use option -a
of mailx
several times, for example:
$ mailx -s 'Few files attached' -a file1.txt -a file2.txt [email protected]
You can also use uuencode
like this:
$ ( cat Mail_Report.txt; uuencode file1.txt file1.txt ; uuencode file2.txt file2.txt ) | mailx -s "SUBJECT" [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With