You can use mail.server in your scripts for that purpose.