Cron to send e-mail

Posted on 1999-01-20
Medium Priority
Last Modified: 2010-04-20
I need to run a cron job that will mail a .txt file to a group of folks on Monday each week.
I run Linux 5.2. I've tried several crons' but no luck.
I know it's simple, but I'm stumped..!
Any help would be appreciated.
Question by:pote
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 51

Expert Comment

ID: 1639213
assuming your mail program is  /bin/mail (and it is BSD-style):

59 23 * * Mon /bin/cat file.txt | /bin/mail -s"subject" user@domain.name

Accepted Solution

HalldorG earned 300 total points
ID: 1639214
Use a script like
/usr/lib/sendmail mailinglist  <<EOF
Subject: the mail every day
From: reply@mydomain.com
To: Mailinglist@mydomain.com

$(cat thetextfile)
And the cron times are the same as abow.

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question