Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt-get install heirloom-mailx
- sudo vi /etc/ssmtp/ssmtp.conf
- mailhub=smtp.gmail.com:587
- hostname=my-domain.com
- rewriteDomain=my-domain.com
- FromLineOverride=YES
- AuthUser=???@gmail.com
- AuthPass=???
- UseSTARTTLS=YES
- #!/bin/sh -x
- sender='send@domain.com'
- recipient='recipient@domain.com'
- zipfile="results/file.zip"
- today=`date +%d-%m-%Y`
- mailSubject='My subject on the '$today
- mailBody=$(cat <<-EOM
- Les résultats de la fiabilisation des données du $today sont dans le fichier zip.
- My-Company
- EOM
- )
- echo $mailBody | mail -s "$mailSubject" -r "My Company <$sender>" -S replyto="$sender" -a $zipfile $recipient
- 05 12 * * * /home/.../script.sh
- /home/.../script.sh > logs/script.log 2>&1
- + mail -s My subject -r My Company <???@my-domain.com> -S replyto=???@my-domain.com -a /home/.../results/file.zip ???@my-domain.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement