SES PHP newsletter cronjob mail sending loop - php

I just started Amazon SES and successfully configured. Actually I purchased for sending news letter as well as member status for my site.
My Site contains about 18000 Users. I want to run a cron job every saturday evening and send them the newest updations and their current status.
Can I fulfil the requirement with Amazon SES ?
Any problem if I looped these users in a mail query ? As I am a new bee to this , any one can please help ?

well it depends. As a new user to ses, i noticed that you are allow to send 10k emails per 24 hours. you have 18k. Could problem yes.
I tried once by sending 5k emails and i got time out issue with php. So i think you need to split 18k into small portion i guess...

Related

PHP timed script execution

I am not quite sure how to put my question into words, but this is what I am trying to build. I want to send email using PHPMailer through my gmail account. Now, Gmail has a limit of 500 emails in one day. Another thing to consider is, when you send a bulk email at once, there is a chance that my email is sent back to me, as my bulk email is considered to be a spam. I have around 200 in my contact list. So a limit of 500 is not a problem. Now my question is, is there any native PHP function that will only execute the send function of PHPMailer in a certain amount of time duration? What I want to do is, I want to send 10 emails from my contact list every 30mins.. So if I have 200 in my contact list, there is an interval of 30 mins in every 10 contacts until I send the email to everyone. I have no problems creating the email script using PHPMailer. I just need to know if there is a way in PHP to 'time' the execution of my functions. I would appreciate any kinds of help. Thank you!
I think you should really look for third party solutions. Sending bulk emails via Gmail or any other provider will create problems for you.
I am using MailGun (with 200 mails you can use FREE version) for years and it does the job.
Don't forget to check mailgun for PHP.

Send a campaign more than once in MailChimp

I am trying to send an email to users based on their status. The first email needs to be sent after 2 hours, and a second one after 24 hours.
I am running a PHP script that checks for users who belong to a state and I sent the first email to them using the send API call, the problem now, is that when the script runs again (a crobtab that runs every 20 mins), I cannot send the campaign again since apparently you can send a campaign only once.
I am putting the cid directly in my PHP code, so I cannot go and edit the code everytime I want to run the crontab!
Do I have to use the campaigncreate()method everytime the crontab runs?
https://apidocs.mailchimp.com/api/2.0/campaigns/create.php
It would be better if there is an easier way, since an account cannot have more than 32,000 campaigns.
Mailchimp is a bulk email service and isn't designed to send transactional emails.
You should instead try to use Mandrill, a transactional email service built by the same company. And their API is quite simple to use.
Then, you can indeed run your PHP script every hour (or x minutes) to send emails based on user status.

How to realize a Newsletter system with Rss news feed?

I have a news portal with everyday news. My need is to send through newsletter the daily news to subscribers.
I've already realized a PHP/MySQL custom newsletter system that performs the following tasks:
fetches the daily news
fetches the list of users who want the newsletter
everynight through a cronjob I launch a script that performs the above every 5 minutes sending the newsletter to 10 recipients at a time each cycle
Problems:
I have to estimate how long this cronjob needs to run in order to complete the full list of users (5' x 10 emails) = 120Email/hours = TotalUsers/emailperhours = number of hours the cronjob needs to run
I overcome this problem because I don't have so much users until now and I can still manage to make the cronjob run enough to send all mails, but for the future?
All email receievers are saved double opt-in, means I'm quite sure of their existence, but it happens how you can imagine that I'll have anyway many Mail delivery for other reasons:
here I need help because I dunno how to catch there Mail delivery through PHP and update MySQL tables in order to suspend these unnnecessary sendings.
Alternatives:
I know that there are many providers who offer Newsletter systems but this works fine every time u go and compile your static email body. Here I need a dynamic email body to be generated every day with fresh news and then send it to recipients.
Still here I need some advice.
You might find it worthwhile using a service like SendGrid - they have an API that handles dynamic content. I haven't tested it out that aspect myself, but for the small price they charge it might be worth saving you the headache.

How to send email in accordance with the time we set in PHP

i want to ask something.
Maybe I will explain the scenario first :
When someone buy an item from my online shop and then they checkout, I send them email about what they buy.
After 1 hour they buy, i want to make some notification for them using email and send to them they must confirm the payment and every 3 hour the same email will be send to them and that email will be send just 3 time in one day. Example: they buy some item at 12.00, at 13.00
the system will automatically send notification to them to confirm the payment,at 16.00 and 19.00 system will send the same email notification again.
If in one day they don't confirm the payment, system not send the notification again and cancel the order or if they already confirm the payment before deadline, system not send the notification again.
How can i achieve the solution for a question 2 and 3?
Thank you so much for your response and solution..
If your xampp is on Windows, you can use windows-schedulers to call a particular script (PHP script in your case, preferably by an URL), which checks the birthdays of all the users and sends them mail accordingly.
If your xampp is on Linux/Unix/etc, you can use cron-jobs, and rest is same!
There is also a third way, a third-party scheduler or say online-cron, which will remotely call yours script (php-page).
**Example:**
If you are doing the cron-settings of OS yourself, you can still let the configure as to whom to email in your system, rather than OS.
Now regarding the time settings, you can make the CRON call your script every our, and you php script will check the appropriate time, and fire the mails!
Refrence Send mail to different customer on their birthday

PHP: Send Email via cronjob and set amount of email send per mins

i have a program which use to send group emails, i set a cornjob per mins for this program, and set execute per 2nd/min, and check if the now time is match to my defined schedule time in db. if true the program will run and send email, else nth...
the problem is i want to dynamic set the amount of email sending per mins by user, let say i have 10000 emails to send, and i want to send 3 emails per min, something like that, but i cant find the way when using cronJob, (set cookie? record the current email to db?),
since i found that if i use sleep(), it will cause php execute limit error...
Can anyone tell me how to do that?
or using other method to do schedule task? pear?
if using other methods, can show how to use it briefly ?
Please And Thx
First of all. 10000 emails with 3 per minute will take over 2 days.
Secondly, the best way to do this is to save the emails to database (to, title, body etc) and then create a script that sends out 3 emails and set the cronjob to run every minute.
Also check out these questions.
Sending bulk email in PHP
Sending mass email using php
Best way to send 10,000+ emails with PEAR/Mail_Queue
I think you should set this configuration at the application level rather than the cron job level.
Let's say, cron job should run every minute but the application itself should know howmany e-mails to send when a cron job runs by checking the datetime for the last e-mail is sent, and let's say, send 3 more e-mails and so.
its only example to said 3 emails per mins
actually i want to give user to set the amount of sending email per min/ per hour/ per second
and i know about the send email program, but what if mutil task doing..
such as 3 newsletter will blast at 20/3/2009 15:15:00; each of those target to 10000pls
i dun want to save the whole blast list in db, since client may import a email list for 40000 ppls, always timeout when import, even i set the time limit to 2 mins, dun want to take more then that time
so do u have any sugeestion on the email sending?

Categories