16 lines
503 B
Python
16 lines
503 B
Python
|
import json
|
||
|
import requests
|
||
|
|
||
|
|
||
|
def send_email(title: str, email: str, msg_body: str, email_api="http://116.63.130.34:30001",
|
||
|
sender="fecribd@fecr.com.cn"):
|
||
|
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
|