Created
August 7, 2017 15:01
-
-
Save samirfor/9fa162f9c6e23280afb17d30429b9589 to your computer and use it in GitHub Desktop.
Send a e-mail using mailx software
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
EMAIL_SUBJECT="Desligamento agendado `date +%d/%m/%Y`" | |
FROM_EMAIL_ADDRESS="[email protected]" | |
FROM_EMAIL_PASSWORD="password" | |
FRIENDLY_NAME="Fela de Tal" | |
STMP_HOST="mail.chupa.br:587" | |
echo -e "Olá, os servidores serão \ | |
desligados dentro de 30 minutos. \ | |
Por favor, finalize seus trabalhos.\ | |
\n\n \ | |
[Esta é uma mensagem automática, não responda] \ | |
" \ | |
| \ | |
mailx \ | |
-r "$FROM_EMAIL_ADDRESS" \ | |
-s "$EMAIL_SUBJECT" \ | |
-S smtp="$STMP_HOST" \ | |
-S smtp-use-starttls \ | |
-S smtp-auth=login \ | |
-S smtp-auth-user="$FROM_EMAIL_ADDRESS" \ | |
-S smtp-auth-password="$FROM_EMAIL_PASSWORD" \ | |
-S ssl-verify=ignore \ | |
[email protected] \ | |
[email protected] \ | |
[email protected] | |
logger "E-mail de aviso de desligamento server cód $?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment