Send mail smtp config
by dba_not_adm9 from LinuxQuestions.org on (#5D9R0)
Hello-
I'm not a sysdamin and if this was already documented somewhere I apologize.
Requirement: Send email as part of shell script with log file as attachment.
My code: echo "Export of database completed at `date`" | mail -s "Subject Here" <email_address> -a logfile.log
The above code runs without any errors but I do not receive the email.
Question: Where do I tell mail command what my smtp relay server for email ? The man page did have options other than creating account and I am not sure if that is the best approach.


I'm not a sysdamin and if this was already documented somewhere I apologize.
Requirement: Send email as part of shell script with log file as attachment.
My code: echo "Export of database completed at `date`" | mail -s "Subject Here" <email_address> -a logfile.log
The above code runs without any errors but I do not receive the email.
Question: Where do I tell mail command what my smtp relay server for email ? The man page did have options other than creating account and I am not sure if that is the best approach.