I created a website to handle event registration with PHP mysqli etc. Upon completing the form on user submit it goes to a payment gateway. Upon payment, the gateway would send a confirmation to a perl page I had created.
In perl I would access the database, mark the registration as paid and send out a confirmation email. I was using MIME::Lite to send the email. My problem was that about 20% of receipt emails didn't seem to get sent...
Does anyone know why this might be? I wondered if it was due to a high volume of users entering payment all at the same time....
Is there a better way to send automatic emails? Should I store receipts in a DB then use something like cron to email batches?
The code I used for emailing was something like the following....
my $receipt = MIME::Lite->new(
To => $emailAddress,
Bcc => 'admin@test.org.au',
From =>'admin@test.org.au',
Subject => 'registration',
Type =>'multipart/related'
);
$receipt->attach(Type => 'text/html',
Data => qq {
eventualy culminating with
$receipt->send();
Thanks for the assist.