JavaScript-How do I implement multiple actions by clicking on a button?

Source: Internet
Author: User
Tags php server
The specific requirements are this:
Now there are some messages that need to be sent by clicking the button
Using mailto, click the button to pop up the default mail window
Also, update the database to mark the recipient of the message as sent
And then show all the unsent recipients.
What should I do with js,php? A little more details, please.

Reply content:

The specific requirements are this:
Now there are some messages that need to be sent by clicking the button
Using mailto, click the button to pop up the default mail window
Also, update the database to mark the recipient of the message as sent
And then show all the unsent recipients.
What should I do with js,php? A little more details, please.

JS to do the queue. The execution of a single task. PHP provides restful API support.

This logic should be wrong, the use of mailto to send mail, should not be able to get the message sent successfully?

Feel that you should PHP SMTP send mail using servers on the server side.

  • The user will fill in the recipient, and send the content successfully, then click Send

  • JS Get the data and pass Ajax the data to the PHP server

  • The PHP service uses the server to send the message to the SMTP specified user, marks the success in the database, and then JS returns the address of the unsent recipient.

  • Ajax After the callback succeeds, the address of the received unsent recipient is displayed with an JS operational DOM structure.

  • 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.