unbale to send mails to distribution list with attachment unix/solaris 10

840 Views Asked by At

trying to send mail to distribution list with attachment, but no luck

seems unbale to identified DL, but when specified with mail ids (e.g. "[email protected],[email protected]") it works fine.

I have Oracle Solaris 10.

code be like..

#!/usr/bin/bash

mailx -s "test_mail" -r [email protected] -t "[email protected]" < text_file.txt

OR

#!/usr/bin/bash

uuencode text_file.txt text_file.txt| mailx -s " test mail" -t "[email protected]"

result

Ignoring recipients on command line with -t
No recipients specified

OR when using "mail" option

mail  -t "[email protected]" -s "test_mail" -r [email protected] < text_file.txt

result:-

mail: Options MUST PRECEDE persons
1

There are 1 best solutions below

0
On BEST ANSWER

Use this command:

uuencode text_file.txt text_file.txt| mailx -s " test mail"  "[email protected]"

DL as such is managed by mail server, -t have totally different role