in my post, i'm use mail command to send message email.
mail -s "Subject title huuphan.com" -S [email protected] <<EOF
----------------------------------------
The content email
Hello
phan van huu
My site: huuphan.com
-----------------------------------------
EOF
The script sending 100 email from command.
#!/bin/sh
i=1
for (( i = 1 ; i <= 100 ; i++ ));
do
echo "Test Mail $i, Send from mail.huuphan.com" | mailx -v -r "[email protected]" -s "Test Mail $i" -a "/tmp/quotausage" -S smtp="mail.huuphan.com:25" -S smtp-auth=login -S smtp-auth-user="[email protected]" -S smtp-auth-password="123456789" -S ssl-verify=ignore -S nss-config-dir=/etc/ssl/certs [email protected],[email protected]
done
Thanks for reading How to send email using mail command in linux My blog Zimbra Mail Server,linux,bash script,centos,linux command I hope this is useful.