How do I send mail from inside a script?
How do I send mail from inside a script?
Thanks! |
You mean email? Use mailx.
HTH, Samsara |
Does mailx use the local send mail agent? Can I point it to another?
|
It could be something like this: (thanks to CAF Johnson for showing me this.
#!/bin/sh messagefile=$1 ## contains the message to be sent [ -f $1 ] || { echo "$messagefile does not exist"; exit 5; } while read email do mail -s "Club newsletter" $email < $messagefile done ## EOS ## email contains the e-mail address. |
All times are GMT -5. The time now is 02:02 PM. |