# Sendmail with cron

**URL:** <https://www.ruby-forum.com/t/sendmail-with-cron/158437>\
**Category:** Rails\
**Created:** [January 23, 2009, 10:53am UTC](https://www.ruby-forum.com/t/sendmail-with-cron/158437 "2009-01-23T10:53:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mikael](https://www.ruby-forum.com/u/mikael)\
**Post date:** [January 23, 2009, 10:53am UTC](https://www.ruby-forum.com/t/sendmail-with-cron/158437/1 "2009-01-23T10:53:30Z")

</div>

Hi!

I’am using crontab for creating an email list every night  
on daily basis. It works perfectly. And use it for other  
things also.

But my problem is that i can’t get crontab to work for armailer,  
i would like to have a crontab for ar\_sendmail -o but can not  
get this to work.

Any one who have the same problem or even better a solution.

Thanks Svea

---

<div class="post-metadata">

**Author:** ![mikael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mikael](https://www.ruby-forum.com/u/mikael)\
**Post date:** [January 23, 2009, 11:03pm UTC](https://www.ruby-forum.com/t/sendmail-with-cron/158437/2 "2009-01-23T23:03:02Z")

</div>

> I’am using crontab for creating an email list every night  
> on daily basis. It works perfectly. And use it for other  
> things also.
> 
> But my problem is that i can’t get crontab to work for armailer,  
> i would like to have a crontab for ar\_sendmail -o but can not  
> get this to work.
> 
> Any one who have the same problem or even better a solution.

Can you get ar\_sendmail to work from the command line? If that works,  
compare the differences in environment variables b/n your interactive  
shell and cron’s environment. Cron is notorious for setting a very  
limited path that does NOT include /usr/local/bin.

For example, on my mac I put this at the top of my crontab file:

PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/  
X11/bin:/Library/PostgreSQL8/bin:/usr/local/mysql/bin:/usr/local/lsws/  
bin:/usr/local/git/bin:/Users/philip/bin

Is it necessary? Honestly I don’t remember… osx may grab things  
from the central location, but I’m in such a habit of doing it I just  
always add it.

Good luck!

-philip

---

<div class="post-metadata">

**Author:** ![mikael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f04885/32.png) [@mikael](https://www.ruby-forum.com/u/mikael)\
**Post date:** [February 5, 2009, 11:22am UTC](https://www.ruby-forum.com/t/sendmail-with-cron/158437/3 "2009-02-05T11:22:20Z")

</div>

Thanks, i missed a line in my path so thats why it did not work.
