Gmail驗證碼傳送

2021-08-21 15:01:27 字數 645 閱讀 3491

伺服器 amazon

伺服器需要配置出站規則,在安全組將 465 埠號 設定為可出站

賬號 gmail 賬號 密碼即可

public class emailserviceimpl implements emailservice ")

private string host;

@value("$")

private integer port;//465

@value("$")

private string username;//賬號

@value("$")

private string password;//密碼

//傳送郵件的模板引擎

@autowired

private freemarkerconfigurer configurer;

public messagetosendmodelmail(emailinfomo info, string code) catch (exception e)

return new messageto<>(0, messagetocode.authcode_send_fail);

}}

若出現連線超時,原因為防火牆,或放在外網伺服器進行測試 

實踐驗證碼傳送

public class telmsgutil 您的驗證碼為 時,此處的值為 request.settemplateparam 選填 上行簡訊擴充套件碼 無特殊需求使用者請忽略此欄位 request.setsmsupextendcode 90997 可選 outid為提供給業務方擴充套件字段,最終在...

傳送手機驗證碼

import random import string import time import hashlib from urllib import parse,request defsend sms 請求的url api 準備headers中的引數 最大128個字元的隨機字串 nonce join ...

手機驗證碼傳送(ThinkPHP)

二 手機驗證碼配置 1.申請容聯雲通訊,註冊個號 2.d wamp www demo thinkphp library org xb 匯入 rongcloud.class.php和rest.class.php 傳送 容聯雲通訊 驗證碼 param int phone 手機號 param int co...