LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-19-2006, 08:51 AM   #1
Phaethar
Member
 
Registered: Oct 2003
Location: MN
Distribution: CentOS, Fedora
Posts: 182

Rep: Reputation: 30
Automate mail with cron?


Hey all,

I've been looking around to see if there's a way to schedule a job to run each day that would send a single file as an attachment to the same 2-3 people. The scheduling isn't a problem, but I've never used the built in mail command before, and I'm not having any luck in finding something that works.

Can a job like this be scheduled? The file name will always be the same, as will the recipient addresses. Any advice will be appreciated.

Thanks!
 
Old 06-19-2006, 09:44 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try using "nail". It's almost a dropin replacement for /bin/mail and it has other useful features too (like sending mails out via SMTP directly instead of passing it to your sendmail/postfix/... MTA first).
It's -a option allows you to attach files.
So, you could put a job like:
echo "This is the mail body: "| /path/to/nail -s subject -a /path/to/attached_file mail_destinations

If the attached file is plain text, you could send it as part of the body of the mail (using standard "/bin/mail" or "sendmail"), but that just isn't as nice as having attachments, is it?
 
Old 06-19-2006, 09:44 AM   #3
imagineers7
Member
 
Registered: Mar 2006
Distribution: BackTrack, RHEL, FC, CentOS, IPCop, Ubuntu, 64Studio, Elive, Dream Linux, Trix Box
Posts: 310

Rep: Reputation: 30
Hello Phaethar,

May be this will help you:-

http://www.novell.com/coolsolutions/feature/11424.html


http://www.petri.co.il/send_mail_from_script.htm
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron mail sending using outside SMTP mail server Utah Linux - Software 6 08-24-2005 07:44 PM
automate script w/ cron viniosity Linux - Newbie 5 02-02-2005 03:13 PM
Mail and Cron makk0 *BSD 1 09-21-2004 12:09 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
need only cron job mail on my mail id manojthakkar Linux - Newbie 0 12-20-2003 05:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration