Email using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eskimo87
Forum Newbie
Posts: 1
Joined: Wed Apr 28, 2010 9:37 am

Email using PHP

Post by eskimo87 »

Hi All,
I have a website hosted at say, abc.com and I have database of registered users with their email id.
Now I want to run a logic and get a subset of the users, and send them an email once a month. Something similar to reminder mail.
As I see, this task is divided in three sub modules-
1. A PHP script with a logic which will get me that subset of users

2. A sendmail($email_id) kind of function which will do the work of sending mail to given address

3. A way to schedule the execution of PHP script (of module#1) and sendmail function, so that email would be sent once in a month automatically


I have module#1 ready but I am stuck with module #2 and #3.
I am new to doing mail stuff using PHP, I want to know
- what all things/settings I should be knowing to do send mail coding in PHP

- I want to send all those reminder emails to users with admin@abc.com as sender , how to achieve that?

- Any pointers to start off with this would be of great help


When I search on how to go about implementing module#3, I found that CRON is preferred way to implement scheduling. But I enquired to my hosting provider and got to know that It is not accessible to me. So please let me know any other alternate ways to implement the scheduling of a PHP script.

Thanks,
Ravi
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Email using PHP

Post by Jonah Bron »

For email, take a look at Swift Mailer

http://swiftmailer.org

I've never setup cron, shared or otherwise. You might try searching for "setup cron on shared host".
Post Reply