Home PHP Libraries Other libraries PHP class for sending Alibaba Cloud SMS verification code
PHP class for sending Alibaba Cloud SMS verification code
<?php
/**
 * 阿里云短信验证码发送类
 */
class Sms {
  // 保存错误信息
  public $error;
  // Access Key ID
  private $accessKeyId = '';
  // Access Access Key Secret
  private $accessKeySecret = '';
  // 签名
  private $signName = '';
  // 模版ID
  private $templateCode = '';
  public function __construct($cofig = array()) {
    $cofig = array (
      'accessKeyId' => '***************',
      'accessKeySecret' => '******************',
      'signName' => '七零',
      'templateCode' => 'SMS_25300059'
    );
    // 配置参数
    $this->accessKeyId = $cofig ['accessKeyId'];
    $this->accessKeySecret = $cofig ['accessKeySecret'];
    $this->signName = $cofig ['signName'];
    $this->templateCode = $cofig ['templateCode'];
  }

InvalidDayuStatus.Malformed' => 'The account SMS activation status is incorrect',

InvalidSignName.Malformed' => 'The SMS signature is incorrect or the signature status is incorrect',

InvalidTemplateCode.MalFormed' => 'The SMS template Code is incorrect or the template status is incorrect',

InvalidRecNum.Malformed' => 'The target mobile phone number is incorrect, and the number sent at a time cannot exceed 100',

InvalidParamString.MalFormed' => 'The variables in the SMS template are not in json format',

InvalidParamStringTemplate.Malformed' => 'The variables in the SMS template do not match the template content'

InvalidSendSms' => 'Trigger business flow control

InvalidDayu.Malformed' => 'The variable cannot be a URL, the variable can be solidified in the template


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Verification code sending and verification logic design in actual docking between PHP and Alibaba Cloud SMS interface Verification code sending and verification logic design in actual docking between PHP and Alibaba Cloud SMS interface

05 Jul 2023

Verification code sending and verification logic design in actual docking between PHP and Alibaba Cloud SMS interface 1. Introduction In the era of mobile Internet, verification code has become one of the important security verification methods in user login, registration and other operations. Alibaba Cloud SMS service provides fast and reliable verification code sending and verification functions. This article will introduce how to send and verify verification codes through the Alibaba Cloud SMS interface in PHP, and give corresponding code examples. 2. Alibaba Cloud SMS interface settings First, you need to activate the SMS service in the Alibaba Cloud console and obtain the corresponding Acc

How to send Alibaba Cloud PHP SMS SMS service verification code How to send Alibaba Cloud PHP SMS SMS service verification code

08 Feb 2018

This article mainly shares with you how to send verification codes for Alibaba Cloud PHP SMS SMS service. I hope it can help you.

Detailed explanation of how to send verification code for Alibaba Cloud PHP SMS SMS service Detailed explanation of how to send verification code for Alibaba Cloud PHP SMS SMS service

15 Aug 2020

This article mainly introduces the method of sending verification code for Alibaba Cloud PHP SMS SMS service. Friends in need can refer to it.

IMEI restricted SMS verification code sending class implemented by PHP, imei verification code_PHP tutorial IMEI restricted SMS verification code sending class implemented by PHP, imei verification code_PHP tutorial

12 Jul 2016

PHP implements IMEI restricted SMS verification code sending class, imei verification code. IMEI restricted SMS verification code sending class implemented by php, imei verification code IMEI restricted SMS verification code sending class implemented by php ?phpclass Api_Sms{ const EXPIRE_SEC = 1800; // Expiration time interval

How to connect PHP to Tencent Cloud SMS interface to implement voice verification code sending function How to connect PHP to Tencent Cloud SMS interface to implement voice verification code sending function

06 Jul 2023

How does PHP interface with Tencent Cloud SMS interface to implement the voice verification code sending function? With the rapid development of the Internet, SMS verification codes have become one of the commonly used authentication methods for many websites and applications. In order to improve user experience and security, voice verification codes are gradually becoming popular. This article will introduce how to use PHP language to connect to Tencent Cloud SMS interface to implement the function of sending voice verification codes. Tencent Cloud is a reliable cloud service provider that provides a wealth of cloud services and API interfaces. Before using Tencent Cloud SMS service, we need to first

Request frequency limit and SMS verification code business design in actual docking between PHP and Alibaba Cloud SMS interface Request frequency limit and SMS verification code business design in actual docking between PHP and Alibaba Cloud SMS interface

05 Jul 2023

Request frequency limit and SMS verification code business design in actual docking between PHP and Alibaba Cloud SMS interface 1. Introduction In modern Internet applications, SMS verification code has become one of the very important verification methods, used to confirm user identity and prevent Malicious attacks, etc. As a commonly used server-side language, PHP is also very commonly connected to the Alibaba Cloud SMS interface. This article will introduce how to connect PHP and Alibaba Cloud SMS interface in actual projects, and combine the design of request frequency limit and SMS verification code to better ensure the application

See all articles