How to Send an Email Using Sendmail Command in Linux
I Tried the Below Two Commands. 1) from: Mail_Id to: Recepient_Mail_Id Hi, This Is My Message, and I'm Sending It to You! . 2) Echo "My Message" | Sendmail -S...
I tried the below two commands. 1) From: mail_id To: Recepient_mail_id Hi, this is my message, and I'm sending it to you! . 2) echo "My message" | sendmail -s subject Receipient_mail_id
But didn't get any mail to the receipient's mail address.
SMTP server is installed on another server ans it is in up and running. So can anyone help me out on how to send a test email through that SMTP server using sendmail or smtp commands?
2 Answers
1. Using sendmail Command:
Created a file with email content:
$cat /tem/email.txt
Subject: Terminal Email Send
Email Content line 1
Email Content line 2
Now send email using the following command:
$sendmail < /tem/email.txt