Hi All,
Before doing this make sure you have installed Sendmail on your malchine.
Now here the question is how to check whether the Sendmail is installed on your machine. If you are
using Linux Environment then please use the below command to identify the Sendmail availability.
$rpm -qa | grep sendmail
if you show some output as some sendmail rpm package name then it seems like it is installed.
You can cross refer the same using below command
$man sendmail
Now all set to go...
1) Create a file as xyz.sendmail
2) open and write 'xyz@example.com' in first line of file xyz.sendmail. Now this line indicate that 'xyz@example.com' is the receiver of this mail
3) open and write 'xyz@gmail.com' in second line of file xyz.sendmail. Now this line indicate that 'xyz@gmail.com' is mark as Cc in this mail.
4) open and write any valid "Subject" you want to mention for this mail in third line of file xyz.sendmail.
5) open and write BODY or Contents of your mail from fourth line onwords of file xyz.sendmail.
6) Once done, use the command as "sendmail -t < xyz.sendmail"
Please make sure that, your machine doesn't have any open relays otherwise your system become blacklisted so that then onwords you can't drop any mails. Also your system should have a fully qualified domain name and having DNS entry. This is must since the mail is going from your machine and 'From' field in the mail should be your machine domain name.
I hope this help you while programming means sending mails through script and also an alternative for mailx command.
Thanks & Regards
Vaibhav Wadkar
Before doing this make sure you have installed Sendmail on your malchine.
Now here the question is how to check whether the Sendmail is installed on your machine. If you are
using Linux Environment then please use the below command to identify the Sendmail availability.
$rpm -qa | grep sendmail
if you show some output as some sendmail rpm package name then it seems like it is installed.
You can cross refer the same using below command
$man sendmail
Now all set to go...
1) Create a file as xyz.sendmail
2) open and write 'xyz@example.com' in first line of file xyz.sendmail. Now this line indicate that 'xyz@example.com' is the receiver of this mail
3) open and write 'xyz@gmail.com' in second line of file xyz.sendmail. Now this line indicate that 'xyz@gmail.com' is mark as Cc in this mail.
4) open and write any valid "Subject" you want to mention for this mail in third line of file xyz.sendmail.
5) open and write BODY or Contents of your mail from fourth line onwords of file xyz.sendmail.
6) Once done, use the command as "sendmail -t < xyz.sendmail"
Please make sure that, your machine doesn't have any open relays otherwise your system become blacklisted so that then onwords you can't drop any mails. Also your system should have a fully qualified domain name and having DNS entry. This is must since the mail is going from your machine and 'From' field in the mail should be your machine domain name.
I hope this help you while programming means sending mails through script and also an alternative for mailx command.
Thanks & Regards
Vaibhav Wadkar