creating a simple script to send mail
Hello I am creating a simple mail script (just got into the world of scripting) My goal is to pretty much test if it has been sent out successful. I know I can just check my email, but is there a way to tell the bash script
(logical thinking) if "mail has been sent" echo success! else echo did not process fi this is my script now #!/bin/bash echo "mail is being sent" echo "...." echo "...." echo "...." echo "...." echo "...." mpack -s hello /disk/windex/users/wchaple/testsample.txt sample@yahoo.com echo "...." echo "...." echo "...." echo "...." echo "...." echo "mail has been sent out succesfully" thank you! |
Comments removed by user, see description below:
|
Couple of things:
|
Quote:
|
The OP seems to be new to Linux, noting that they've said they're new to scripting, and perhaps they found the first thing which worked and also perhaps the program, while having nefarious origins may also have test and/or reasonable use cases. Hence why I said let's allow a moderator to make that judgment. I know there are other ways to generate mail from the command line, such as "sendmail" or just "mail".
|
While a malware name MPack exists, this is not what the OP is referring to. A different (ancient) program named mpack exists which can be used to send mails, see here:
http://linux.maruhn.com/sec/mpack.html http://linux.die.net/man/1/mpack |
Code:
echo "message" | mail -s "subject" user@domain.com If your ISP does block it, you'll need to use an external smtp server to send the email. For that I've had a lot of experience with sendemail: http://caspian.dotconf.net/menu/Software/SendEmail/ It works great, the only drawback is the login and password for the smtp server need to be stored in plain-text. |
All times are GMT -5. The time now is 04:49 AM. |