Solved

Send emails automatically every week

Posted on 2008-06-26
2
217 Views
Last Modified: 2013-12-13
I am using WAMP. In my database I have a date field with stores dates as this
bend_distroct
6-30-2008
12-31-2008
12-1-2008
12-1-2008
5-30-2008
6-30-2008
2-27-2009
2-26-2009
12-1-2008
2-27-2008
2-11-2009
2-11-2008
2-11-2009
2-11-2008
5-1-2008
5-1-2009
5-30-2008
5-1-2009
5-1-2008
12-1-2008
6-1-2008
6-30-2008
11-9-2007
5-30-2008

What I want to do is send email that has a date which is one week from today. And I want to send all the records belonging to that date.
I have already setup task which will run the script everyday. I need the script.
Thanks
0
Comment
Question by:syedasimmeesaq
2 Comments
 
LVL 6

Accepted Solution

by:
mmarth earned 250 total points
ID: 21880448
$query="SELECT * FROM Database WHERE (TO_DAYS(now())=TO_DAYS(adddate(bend_distroct,7))) ";
0
 
LVL 3

Assisted Solution

by:Bivek-jos
Bivek-jos earned 250 total points
ID: 21882055
$query="SELECT * FROM Database WHERE (TO_DAYS(now())=TO_DAYS(adddate(bend_distroct,7))) ";

Write a script to send mail. (including the above query)

Now you need to schedule a "cron job"() to be run daily.

"Cron job" will run your script on daily basis.

If you don't know about "cron job" then search for it in google.Or search it in your cpannel or whm guide.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
calculated column 12 74
How can i modify my File download link ? 6 47
Configuring a checkbox in CSS and php 18 27
array_values - reorder after unset? 5 9
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

914 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now