Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Email in Bash (See related posts)

//Bash email
#!/bin/bash

function email
{
echo "this is a test" | mail -s "test" "$1"
}

if [ "$1" = "" ]; then
echo "nothing in param"
else
echo "sending mail"

#emailing attachment
#uuencode statsNbaAllStarSim statssim | mail -s "test attachement" atayebali@foxsports.com
#uuencode <filename that will be send> <name for attached file that is sent> |

#passing the param to function
email $1
fi


You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts