Utilize shell scripts,linux commands, open source tools,java, to Maximize the Power of Linux.
Focused on working with linux and shell, search engine technology including Chinese segmenter
Any questions please contact me at gmail: david.ullua


send mail with attachment in command line

if it is a normal text file, you can use redirection to send the file as

mail -s "hello, david" someone@abc.com someone2@kseeker.com < attachfile

if it is a binary file, or you want to send text file as real attachment:

mail -s "hello, david" -a attachfile someone@abc.com someone2@kseeker.com

btw, mail is often the alias of mailx command in linux.

No comments:

About Me

I am a senior developer and a team leader with 3 years development experience in Suzhou, China, focus on mobile web search, linux, Java and machine learning in NLP (natural language processing). My goal is to improve people's life with computer technology.