-2

I am facing a problem with sending email about status. Basically I want to create script which send email every morning with some data from database. My goal is to write PHP file which will send email. I can create this file but I dont know how to call this file in right time. I guess I have to work with server configuration (installing email protocols or creating server's email) I have not been working with server on this level yet so I dont know how it works even in theory. I would appreciate if someone can advise me how it works and tell me the easiest way to create it.

Thank you for every answer.

  • This will help you in setup E-mail http://stackoverflow.com/questions/712392/send-email-using-the-gmail-smtp-server-from-a-php-page – Pardeep Dhingra Jun 12 '15 at 19:19
  • 1
    Look into cron jobs to automatically run a script at a given time – Simian Jun 12 '15 at 19:19
  • This will help you send email on particular time ..cron jobs http://stackoverflow.com/questions/3368307/how-to-send-emails-via-cron-job-usng-php-mysql – Pardeep Dhingra Jun 12 '15 at 19:21

1 Answers1

2

You should be using cron, here are some explanations and examples : https://www.pantz.org/software/cron/croninfo.html

If you do not have access on your hosting to configure cronjobs, there are online services who can call your php for you but you'll have to rely on them. Look for "web cron" on Google.

jde
  • 176
  • 8