tin-cat / emailqueue Goto Github PK
View Code? Open in Web Editor NEWA fast, simple yet very efficient email queuing system for PHP/MySQL
License: MIT License
A fast, simple yet very efficient email queuing system for PHP/MySQL
License: MIT License
Kindly implement RestFull web service for same. It would be more useful.
Thanks.
The database fields is_sent
, is_cancelled
, is_blocked
are NULL by default and their labels say "Do not specify this field when manually inserting.".
However if a message is manually inserted into the table, it won't be delivered unless those fields are 0 (condition in delivery.php
), in fact the inject
function of emailqueue_inject_class
sets them to 0.
So I'd either change their default values to 0 instead of NULL, or change their description specifying to set them to 0.
Hi there, this might not be an issue and more my setup, but is there a way to enable some sort of debug output of the delivery part?
I've a dedicated host running PLESK and I have a domain setup with email (email works fine with outlook, secure, port authentication required on 465 etc.). I unzipped your package to a folder, did the configuration, database setup and download PHPMailer from their git, dumped those files into the PHPMailer folder you had.
Now emails are added to the queue/db, the cron is triggered, the email gets flagged as being in process of being sent but nothing happens after that and it remains as "sending now". If I run the delivery.php directly in my browser it takes some time, 30 sec maybe before it gives me a server 500 error message (so I guess the issue is there). BTW if I run it without an email pending it will give me some output;
Emailqueue · Delivery
Maximum delivery timeout: 50 sec.
Delivery interval: 0,10 seconds
Maximum emails to deliver: 1000
Process started on: 19/1/2017 22:40.55
No emails on queue.
Process ended on: 19/1/2017 22:40.55
I've tried with SMTP_SERVER set to localhost, 127.0.0.1 and the server IP with same result. I've not configured anything with PHPMailer as I presumed that's controlled by your system. The timeout only happens with port 465 (which is what I use), using any other port gives a "Could not connect to SMTP host." and similar
UPDATED; foud this from my general server log:
`2017-01-20 00:03:04 Error myip 500 GET /assets/custom/plugins/emailqueue/scripts/delivery.php HTTP/1.0 1.76 K Apache SSL access
2017-01-20 00:03:50 Warning myip mod_fcgid: read data timeout in 45 seconds Apache error
2017-01-20 00:03:50 Error myip End of script output before headers: delivery.php Apache error`
From where I am, what I did to install, and the error 500 received only when it tried to process an email, any clue as to get some error debug output or what I can try next?
Chris
To be able to add a link to each sent email like: "Can't see this message? Click here to see it in your browser"
Should be secure: Generated links to see each email should be secured with a unique, strong hash so only the individual addressee knows it. If not implemented properly, it could easily lead to a serious bug where anyone can see any sent message.
Hello,
I configured the script to use either one to set the Return-Path and it does not work. I am on PHP 7.3. Does anyone know of a fix for this. Thanks.
$mail->addCustomHeader('Return-Path: [email protected]');
OR
$this->mail->Sender = '[email protected]';
It did not send me an email using SMTP, it showed an error: "SMTP Error: Could not connect to SMTP host.".
In common.inc.php I added the line "$mail->SMTPSecure = SMTP_SECURE;" and in config line add "define("SMTP_SECURE", "ssl");", emailing works.
if (SMTP_IS_AUTHENTICATION) {
$mail->SMTPAuth = true;
$mail->SMTPSecure = SMTP_SECURE; // ADD LINE
$mail->Username = SMTP_AUTHENTICATION_USERNAME;
$mail->Password = SMTP_AUTHENTICATION_PASSWORD;
}
Is it possible to add an attachment already in base64 format and not as a file on the filesystem?
I'm asking because I'm not saving the file to the hd but generated on the fly to save space and issue
thanks
It just crossed my mind to check on emailqueue today and was very happy to see there had been an update. I'll be updating my tiny implementation soon and love the emailqueue_inject::inject parameter option! Hope there's more improvements and updates due :) keep up the good work.
Hi
Thanx for the code, I improved it and added "to_name" and also changed mktime() to time() as that results is some warnings , time() more efficient for timestamp 'now', my research suggests.
Ok I have 30 000 emails queued and it is sending at about 3/sec, am using SendGrid API Free with 40 000 emails free to test, by this rate I will finish sending in 25 hours, now I have a list of 120 000 subscribers, this would take I think3-4 days, how to speedy things up?
Delivery:
I am calling the delivery.php directly via wget from cron job (not secure), my server wont fire the bash file, is the bash script file calling better that calling the delivery.php directly? If so why?
My setting are the default:
EnvironmentProduction
Maximum delivery timeout50 seconds
Delivery interval100 ms.
Maximum retry attempts3
Maximum delivers per call1,500
SMTP serversmtp.sendgrid.net
The example is great for sending one email to queue, but how do I send many at the same time? Could you please provide an example for that?
Hi is it possible to implement twig template when sending email? If yes how to achieve it without altering your library? Many thanks
Hi,
If I'm not completely wrong, I think PHPMailer accepts TO_NAME and not only the email of the recipient.
It would be a simple and easy enhancement that 'should' help delivery performance.
Thanks for your great job.
Ais
Hi Tin Cat, just here to say "hello" and to check if you're still using this... not yet critical, but hoping see an update this year adressing anything posted as issues, some improvement and fixing of anything potentialyl flagged as "depricated" as to fully support php 8. Loving this tool and still using it but concerned it might stop working sooner or later.
Right now, only the last N messages in the queue are shown on the frontend. Improve this so the admin can browser through the entire queue and even perform searches and filterings.
Before I debug this further, is there a character limit or something for the email content? It seems my emails are cut short (just stops mid-sentence) on the content side after some 62k+ characters through using the inject class.
File logging has been commented because some errors were found when emailqueue tried to write/create log files without filesystem permissions.
Code is so old that it's not really following any coding conventions. Even tabbing is broken. Reorganize the code, function names, tabbing and coding conventions to make it look clean and tidy.
I don't know if it's a issue, but I had to add the lines attached to work on port 587 in CPANEL when
define("SMTP_PORT", 587); // The port of the SMTP server
define("SMTP_IS_AUTHENTICATION", true); // True to use SMTP server Authentication
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
Hello,
I discovered today that the blacklist email feature did not work. Emails were sent to users who were blacklisted. I am on PHP 7.3.3
Here are the two fixes to get it to work:
function deliver_email(&$mail, $email, $isOutputVerbose = false) {
global $blacklisted_emails; // Declare $blacklisted_emails as a global variable because this array is not sent to the function.
I use docker to install emailqueue. I use http://ip:8081/test.php to adds 43 requests.
But all request is not yet delivered.
How to I fix them?
Hello,
The PHP version on the server is PHP 7.3.17
I just see a blank page when I go to the frontend. The API POST request does not send. The response is blank.
Any idea what could be the problem? Thanks!
Standard PHP installs default to short_open_tags Off so this is a bit of a headache.
The email standard allows for + in the email address to give the options to tag but still go to the same email account https://en.wikipedia.org/wiki/Email_address
Line 54 in eae3d40
Would you be ok to add that to the regex?
Hi, is it possible to install emailqueue without Composer? As I'm going to use it in a shared hosting.
I'd add the php version and especially the required extensions in composer.json
, e.g. the mysqli extension (I hadn't installed it by default and got an error while loading common.inc.php
).
Add support for file attachments, specially for attaching images that are used in the email's HTML itself. Should be difficult, because attached files should be stored somewhere while the email is in the queue (or even when it's been already sent).
Can lead to huge storage usage: Imagine sending 100k newsletter emails, each email on the queue having its own file attached, stored on disk even when the file is the same for all of those 100k emails. This should be addresses in a way that attached files become referenced from each mail to files stored by emailqueue, so the same file is only stored once even if there are lots of emails on the queue referencing to that file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.