?
Solved

Automatically send a Happy Birthday email on users' birthday

Posted on 2005-05-03
9
Medium Priority
?
2,599 Views
Last Modified: 2013-12-12
The question seems easy enough...

When a user signs up at a website, they have the option of entering their birthday as part of their user profile.  I would like to be able to send a Happy Birthday email automatically to them on their birthday...

They would also need to have the option to opt out of the birthday email...

It would be nice to keep it strictly php / mysql (no cgi, java, etc.)

Any ideas??

Thanks
0
Comment
Question by:jlavetan
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 3

Accepted Solution

by:
Timothy Golden earned 272 total points
ID: 13921404
well a cron job would work
Do you have access to the CRON on your server?
If you do then you can create a PHP script that can be called via CRON

If you dont have access to the CRON on your server then you couls create a PHP script that will get called every time the Index page is losded, but thiw will add more overhead to your site.

I suggest that you create a CRON job to run a PHP script at a given off peek time daily.
0
 
LVL 4

Assisted Solution

by:ShelfieldCollege
ShelfieldCollege earned 264 total points
ID: 13925450
If you're running on a windows environmeny you could also use the scheduled tasks to run your PHP script every morning which will then send out the emails to people who's birthday it is.

Cheers

-Matt-
0
 
LVL 1

Author Comment

by:jlavetan
ID: 13925759
I do have access to to cron, but did not want to use them if possible....  

This is on a linux server....

Couldn't this be done strictly with a php script?

I'm not exactly a php expert, but it seems like it could be done...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Expert Comment

by:Timothy Golden
ID: 13926040
CRON would be the best way to make sure your script will run every day at a given time.
0
 
LVL 9

Assisted Solution

by:AlanJDM
AlanJDM earned 264 total points
ID: 13928315
Yes, the email can be sent via a script. But what is going to execute the script every day? That is why you need cron.


Alan
0
 
LVL 1

Author Comment

by:jlavetan
ID: 13928373
The script would execute everytime the user logs in to the site...  

Their birthday would be part of their user profile...
0
 
LVL 9

Expert Comment

by:AlanJDM
ID: 13928701
Well that isn't what you originally asked...

"Happy Birthday email automatically to them on their birthday"

Having it execute during login isn't automatically. What if they don't login on thier birthday, they won't get the email until the next time they do login. If they don't login for a week do you really want to send an email a week late?

Anyway, the way to send an email via a php script is with the mail() function...

http://us4.php.net/manual/en/ref.mail.php

However, I say again, the only way to "automatically" execute a script without human intervention such as the user logging in is via a sheduler such as cron.



Alan




Alan
0
 
LVL 10

Expert Comment

by:Kshitij Ahuja
ID: 15679337
No comment has been added to this question in more than 21 days,so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
[Points Split {luckynh},{ShelfieldCollege} and {AlanJDM}]

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Kshitij Ahuja
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

862 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