Cheng with you to send SMS verification code

Source: Internet
Author: User

Now whether it is the website, or the app and other Internet and mobile internet products, most of the registration is directly registered with the mobile phone number registration, the way is to send SMS verification code, and then fill in the verification code, the background program to match to determine the user fill in the Verification code and send the consistency.

I recently done several projects have used to send SMS verification code of this third-party interface, in fact, the principle of sending verification code is very simple, the implementation is very simple.

The following three graphs are the results of one of the projects I did:


I use more of the third-party SMS interface is the http://www.yuntongxun.com/-cloud communication (the), its API is very powerful, but also very stable, use is not difficult, there are related use tutorials.

Next, I'll step through the process of explaining how I use the SMS API for cloud communication.

The first step: first to register a business developer account, and then the enterprise certification, and finally to the account to recharge at least 500 yuan (account must be at least 500 yuan to use the SMS interface).

Step Two: Create the development app as shown in:


step three: Submit the SMS template to send the verification code for approval (every weekday morning at nine, so we recommend that you try to submit a text message template before nine o'clock in the morning.)


       This page is not the general ugly, is particularly ugly, no way, their front-end is not cow, in order to deal with the audit, the style is not important, the most important function effect.

Fourth: Load the third-party interface class (I'm using the thinkphp framework, I've encapsulated this class, and placed it underneath/libs/thinkphp/library/org/util/)


Fifth Step: Configure the profile to configure the relevant accounts and keys for the SMS interface


Sixth Step: Controller (Service-side method)




Seventh Step: Front page





        I in the development of this SMS authentication code interface, give me the biggest trouble is the text message template audit, Audit three times to pass, because I provide audit of the registration page of the picture verification code is not strong enough, no JS to verify the effect of the judgment and no hint 60 seconds countdown effect.


In addition, in the configuration of the account, key, SMS template ID, production address and development address to write the right, the general attention to these small issues, the development process will be very smooth.


Full Code pack Download: Https://yunpan.cn/cqaPTE9CVk6JK

Extraction Code: 09E9


Now is the information explosion era, information flooding, in such a social environment, good original article is the most need, the most should not be drowned, so I began to write articles. This is my seventh article, is about the use of third-party cloud communication SMS API, mainly to introduce how I use the API to send SMS verification code, as well as I encountered in the development process problems and how to solve. My principle is always to recommend good things & share my experience and make progress together. May be a lot of places do not write well, please point out.

I always think that writing articles is the best way to think, not only to share, but also to precipitate themselves. The article on Zhang Talk is about sharing interesting stories and experiences about technology, products, entrepreneurship and life.


Cheng with you to send SMS verification code

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.