-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/email
Copy pathMore file actions
executable file
·22 lines (20 loc) · 804 Bytes
/email
File metadata and controls
executable file
·22 lines (20 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
destino=$1
remitente="user@mail.com"
servidor="smtp.mail.com:25"
#credentials
usuario=$remitente
password="contraseña"
#Message
Asunto=$2
Cuerpo=$3
if [ $# = 3 ];then
swaks --to $destino --from $remitente --server $servidor --auth LOGIN --auth-user $usuario --auth-password $password -tls --add-header "Content-Type: text/html" --data "Date: %DATE%\nTo: %TO_ADDRESS%\nFrom: %FROM_ADDRESS%\nSubject: $Asunto \n%NEW_HEADERS%\n $Cuerpo \n" > /dev/null
echo -e "\033[0;32m[+]\033[0;0m Sent successfully."
elif [ $# -gt 3 ];then
echo -e "\033[1;31m[-]\033[0;0m It only needs 3 arguments."
echo -e "email.sh [destino] [asunto] [mensaje]\033[0;0m"
elif [ $# -lt 3 ];then
echo -e "\033[1;31m[-]\033[0;0m It needs arguments"
echo -e "email.sh [destino] [asunto] [mensaje]\033[0;0m"
fi