This is the program who sends email. it takes 8,192B of disk space after installation
its quit simple to use.
for that we have to edit /etc/ssmtp/ssmtp.conf like below
——————————————————————————-/etc/ssmtp/ssmtp.conf——————–
FromLineOverride=YES
root=your_username@your_domain
mailhub=smtp.your_domain.com:587
#$hostname=sysadmins —-> this line doesn’t affect after commenting
rewriteDomain=your_domain
AuthUser=your_username
AuthPass=your_password
FromLineOverride=YES
UseSTARTTLS=YES
—————————————————————————————————————————–
The normal command to send email via command line is
ssmtp recepient_name@gmail.com
To: recipient_name@gmail.com
From: username@gmail.com
Subject: Sent from a terminal!
Ctrl+D
——————————————————————————————————————————
script to send message using text file
—————————————————————————————————————————–
function welcome_mail
{
echo enter user name
read username
echo enter full name
read FULL_NAME
USER=$username
FULL_NAME=$FULLNAME
cat > /tmp/welcome-reciepent << welcome1
To: $USER@your_domain
From: System Administrator
Subject: Welcome! Please read the instructions
Hi $FULL_NAME,
Welcome , Please go through the instructions given below
welcome1
cat /file_path/instructions >> /tmp/welcome-reciepent
echo “Sending Welcome-mail”
ssmtp $USER@neuralit.com < /tmp/welcome-reciepent
echo “OK”
}
welcome_mail
———————————————————————————————————————————–
and the /file_path/instruction is a simple file in which instructions are written.
like this.
this is instruction1
this is instruction2
this is instruction3
this is instruction4
(Please don’t revert back. This is a system generated email)
merits: 1) simple to use and can be used to mail newly joined user.
2) the mail can be sent by using any mail account as the sender will not be shown (it will show the name we choose.)
3) user cant reply back as there is no emailid in sender
demerits : 1) we can not attach the file.(searching the solution)
2) we will have to install the software for it