FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Running function in the background?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Running function in the background? [message #176578 is a reply to message #176576] Tue, 10 January 2012 02:06 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
John Drako wrote:
> I have a site where users can download files, and I want to enable the
> users to request files by email. Some of those files are big (not too
> big for email attachements).
>
> What I would like to have the user be able to do is to click on a file
> and have it emailed to him, but the user shouldn't have to wait for the
> emailing function to finish (tens of seconds some time) and continue
> browsing and clicking on other files to email or even leave the site
> confident that they'll receive the files in their email later.
>
> So I would like the emailing functionality to happen in the background
> and independent from the connection to the browser.
>
> Is this possible? Is it doable in PHP directly?
>
it happens anyway.

the 'program running in the background' is the mailer daemon.

When you invoke php mail() function all that does is validate the
addresses and queue the e-mail.

sendmail (or whatever) then forks to do the actual sending as a separate
process. (or not if you use the queue only functionality: In that case
the mail will get sent in the next queue run - maybe every hour typically)



Now making up an external file as the message body is trivial, but
making it an attachment is not.


But even fairly large attachments - 5-10MB - is not too hard. And won't
tie up php too much o for too long.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: form - file - sumple question
Next Topic: Lilupophilupop
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 02:26:01 GMT 2024

Total time taken to generate the page: 0.04545 seconds