import json import requests email_api = "http://116.63.130.34:30001" sender = "fecribd@fecr.com.cn" def send_email(title: str, email: str, msg_body: str): headers = {"Content-Type": "application/json;charset=UTF-8"} data = { "title": title, "sender": sender, "recipients": [email], "msg_body": msg_body } res = requests.post(url=email_api + '/send_mail', headers=headers, data=json.dumps(data), timeout=5) return res.status_code == 200