php email notification

by 4 replies
5
hello,

i am developing a php program for a hostel. i want get a email notification on a special date if anyone don't pay rent. how can i do this on php .. any idea ?

----------------------------example -----------------------------

hostal have 25 rooms.. one person joind hostal on 15th date his room number is 15, so every month 15 th date i want to get a email notification if he not paid rent ...


any idea ?
#programming #email #notification #php
  • Hi,

    you can use cronjob for this purpose.

    create a php file, in it code in such a way that,
    compare every day with the day mail wants to be send.

    And set the file to run once every day.
    • [ 1 ] Thanks
    • [1] reply

    • thanks ... i don't know about cronjob ( i am a newbie to php ) . i will googling about this .. if i don't get any thing ..i will disturb you again ..
      • [1] reply
  • In most cases cron jobs can be set up easily through your host and cpanel.

    The set up is something like seconds, minutes, hours, days, etc and the command line for running your script

    So for instance *,*,*,1 would mean run every day the command you set.

    If this does not work or you dont want to run it via cron job simply navigate to the script url and have it print out their info including room and date they paid. Then simply set up date using strtotime to convert 31 days to the proper date and if todays date is equal to the day after rents due then set off the mail function.

    Hope this helps

Next Topics on Trending Feed