This is the sample script to send mail using script. I have used perl . You can try with shell script also , with the same way.

— Contents of testmail.pl —
#!/usr/bin/perl

$mailcmd=”/usr/lib/sendmail -t << EOF
To: linux-cloud@nodomain.com
From : linux-cloud@nodomain.com
Subject : Linux-cloud cars

I love luxury Cars, SUV

EOF”;

`$mailcmd`;
# script ends

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like
Read More

NFS mount options

Some important nfs mount options in Linux. tcp – Specifies for the NFS mount to use the TCP…