Python3實現傳送郵件和傳送簡訊驗證碼
阿新 • • 發佈:2021-02-20
技術標籤:python AI BlockChain
import smtplib import re from settings import bind from os import environ from os.path import exists from platform import system,node from time import strftime from email.mime.text import MIMEText from email.utils import formataddr from random import randint from easygui import msgbox,enterbox print('庫載入完成') title = '這是標題(請自行更改)' my_sender = '
[email protected]' #發件者郵箱(請自行更改) my_pass = 'QFAQPLFQZRZBMVWQ' #授權碼(請自行更改) dt = strftime('%Y-%m-%d %H:%M:%S') print('已經獲取時間') my_user = userMail username = environ['USERNAME'] system = system() computer = node() number = randint(100000,999999) #驗證碼 err = Exception print('裝置資訊獲取完成\n變數定義完成') def mail(): global err ret = True print('巢狀入檢查語句') try: msg = MIMEText('這是郵件內容(請自行更改)'), 'plain