How to handle phpfsockopen concurrency?

Source: Internet
Author: User
Phpfsockopen concurrency: fsockopen concurrency. I want to send an email without knowing how to send an email to fsockopen. you can use ajax to send the email cyclically, or use the following two methods (the Western code is the general idea ): PHPcodeif (isset ($ _ GET ['php fsockopen concurrency
Ask for fsockopen concurrency.
I want to send an email. I don't know how to send an email to fsockopen.

------ Solution --------------------
You can use ajax to send emails cyclically, or use the following two methods (the Western code is the general idea ):

PHP code
If (isset ($ _ GET ['AC']) & $ _ GET ['AC'] = 'sendmail') {sendEmail (); // send email operation} function fSockGet ($ url, $ timeout = 3) {$ info = parse_url ($ url); extract ($ info ); $ query = isset ($ query )? Trim ($ query): ''; $ path = isset ($ path )? Trim ($ path): ''; $ fp = fsockopen ($ host, 80, $ errno, $ errstr, $ timeout); if (! $ Fp) {exit ("$ errstr ($ errno)
\ N ") ;}$ write = fwrite ($ fp," GET {$ path }? {$ Query} HTTP/1.0 \ r \ nHost: {$ host} \ r \ n "); // while (! Feof ($ fp) {// echo fread ($ fp, 4096); //} $ url = "http://mydir.com/index.php? Act = sendMail "; $ emailList = array (...); foreach ($ emailList as $ email) {fSockGet ($ url );}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.