They probably just store the request to a database and then use a sentinal program to send it out. And yes php do this by using either an auto refreshing script or a propriitory sential program.
The easiest of the two of course is the script, what you do is have the user post the message they wish to send, that message gets stored to a database, the sentinal script will be running in a browser window on your computer, it will refresh every couple of seconds (minutes, depending on your needs) and check the database for new tasks and it will go about performing this tasks behind the scenes for the user.
Thou if your using linux (BSD, Etc.) for your sever there are probably hundreds of good email sentinal programs that would perform this task for you without hassle, so that may be easier depending on your situation.