PHP code example of stefein / submail-sdk

1. Go to this page and download the library: Download stefein/submail-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stefein / submail-sdk example snippets

`


use Stefein\Submail;

/*
*   @sign_type  为 md5 sha1 或者 normal 
*   @config   =   array('appid'=>xxxxx,'appkey'=>xxxxxxxxxxxx,'sign_type'=>'md5');
*   以上为基本参数
*   使用模板发送 则需要加入 控制台项目名称project,如:JCB6G2 
*/

$obj = new Submail($config);
`
$vars   =   array('code'=>rand(100,999));
$obj->messagexSend("130*********",$vars);
`
$vars   =   array('code'=>rand(100,999));
$obj->voiceXsend("131********",$vars);
`
$data=[
    ['to'=>'131********','code'=>rand(100,999)],
    ['to'=>'130********','code'=>rand(100,999)]
];
$obj->voiceMultixsend($data);