Jump to content

Recommended Posts

hey guys,

 

quick question

 

whenever I sent a simple email message it takes the server about an extra 1-3 seconds mostly just 1.25ms

 

but the problem is i have a redirection feature, so if someone send's someone a Message, it redirects them (a simple redirect page)

 

 

so the code looks like this:

 

blahblahcode

insert into message

redirect user to messenger page

send mail function

 

 

 

 

the problem is, if I put the sendmail function above the redirect, it lags for like 1-2 seconds to send the mail and the redirection is not instant. (feels like the site is lagging)

 

how do I go about, sending that email after I click redirection so that's instant, but the mail processes after redirection instead?

Link to comment
https://forums.phpfreaks.com/topic/270587-php-mail-lag/
Share on other sites

you could redirect to a page with a hidden div / iframe that you use to run the mail script. this should keep the ui flow smooth and let the mail be processed "in the background" so to speek. Only problem would be if the page they end up on is closed or navigated away from before the sendmail is completed, then it may not send at all.

Link to comment
https://forums.phpfreaks.com/topic/270587-php-mail-lag/#findComment-1391794
Share on other sites

you could redirect to a page with a hidden div / iframe that you use to run the mail script. this should keep the ui flow smooth and let the mail be processed "in the background" so to speek. Only problem would be if the page they end up on is closed or navigated away from before the sendmail is completed, then it may not send at all.

 

This is a good idea, any others? ( I can set a spam session on that page to, use the same session to store how many seconds per message) so they cannot be spammed. (Or if they get even more dirty just use the db)

Link to comment
https://forums.phpfreaks.com/topic/270587-php-mail-lag/#findComment-1392156
Share on other sites

You can use a cron ob to send the php scrips like a demon.

In the same way I've sent about 2000 mails to my subscribers in 30 min delay..

 

Do you need to give you an example about this ?

Edited by jazzman1
Link to comment
https://forums.phpfreaks.com/topic/270587-php-mail-lag/#findComment-1392160
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.