# How to send an email on a particular date

**URL:** <https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130>\
**Category:** Rails\
**Created:** [March 17, 2008, 9:44am UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130 "2008-03-17T09:44:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [March 17, 2008, 9:44am UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130/1 "2008-03-17T09:44:48Z")

</div>

Hello people, I am trying to create a application where a person can  
set a reminder. for example a person may choose a date on which he  
wants the email to be sent to his email id, on submitting this data a  
cron job should start which would run daily and would deliver the  
email on the particular day at particular time. How can i achieve  
this? any help would be appreciated…  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [March 17, 2008, 10:24am UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130/2 "2008-03-17T10:24:23Z")

</div>

Thanks for the suggestion fredrick…Can you please tell me is it  
possible to do this using unix cronjob?? or do i need to use only a  
plugin backgroundrb or rubycron and lots of others??I wanted to do  
something like a file which is a .rb file inside crontab directory and  
then daemon would be created which would run this script… Somethig  
like this…I am not very sure how you can do this but do u have any  
idea of doing it like this??

On Mar 17, 1:57 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [March 17, 2008, 9:57am UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130/3 "2008-03-17T09:57:53Z")

</div>

On Mar 17, 8:43 am, dhaval [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello people, I am trying to create a application where a person can  
> set a reminder. for example a person may choose a date on which he  
> wants the email to be sent to his email id, on submitting this data a  
> cron job should start which would run daily and would deliver the  
> email on the particular day at particular time. How can i achieve  
> this? any help would be appreciated…  
> Thanks in advance.

Well it’s going to need to run a hell of a lot more often than daily.  
You’re going to want some sort of background process (cronjob,  
backgroundrb, long running ruby script, etc…). Then you’ll probably  
have a table with what needs to be sent and when. Whenever your  
background process wakes up you just check whether anything needs  
sending now.

Fred

---

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [March 17, 2008, 11:09am UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130/4 "2008-03-17T11:09:15Z")

</div>

On 17 Mar 2008, at 09:23, dhaval wrote:

> Thanks for the suggestion fredrick…Can you please tell me is it  
> possible to do this using unix cronjob?? or do i need to use only a  
> plugin backgroundrb or rubycron and lots of others??I wanted to do  
> something like a file which is a .rb file inside crontab directory and  
> then daemon would be created which would run this script… Somethig  
> like this…I am not very sure how you can do this but do u have any  
> idea of doing it like this??

Well cron will quite happily run ruby scripts if that’s what you’re  
asking

Fred

---

<div class="post-metadata">

**Author:** ![dhaval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Post date:** [March 17, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/how-to-send-an-email-on-a-particular-date/132130/5 "2008-03-17T16:15:17Z")

</div>

Thanks for that. I actually meant that

On Mar 17, 3:08 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
