0

I'm using drupal_mail() to send mails from the HTML formatted content.

It takes more time to send mails. Actually, Mail is triggered while the form submission after the save logic.

To save the page loading time, how can I send emails in an asynchronous process?

1 Answer 1

1

As far as a pre-built solution goes, you can try the Background process module, which would theoretically allow you to do something like:

$handle = background_process_start('drupal_mail', $module, $key, $to, ...);

Beyond that Drupal has nothing to help, so If you don’t use that module, just approach this as a general PHP task. The options and difficulties for async/background processing in PHP are very well documented around the web.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.