mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-05-30 13:37:06 +00:00
Update smtp.py
This commit is contained in:
parent
01db314f0a
commit
f4d54d1b4e
12
smtp.py
12
smtp.py
|
@ -103,12 +103,12 @@ class CaterpillarSMTPServer(SMTPServer):
|
||||||
# send HTTP POST request
|
# send HTTP POST request
|
||||||
try:
|
try:
|
||||||
response = requests.post(server_url, data=raw_data, auth=auth)
|
response = requests.post(server_url, data=raw_data, auth=auth)
|
||||||
response_json = response.json()
|
if response.status_code == 200:
|
||||||
success = response_json.get('result', {}).get('success', False)
|
type, id, method, rpcdata = jsonrpc2_decode(response.text)
|
||||||
if success:
|
if rpcdata['success']:
|
||||||
print("[*] Email sent successfully.")
|
print("[*] Email sent successfully.")
|
||||||
else:
|
else:
|
||||||
print("[*] Failed to send email.")
|
print("[*] Failed to send email.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("[*] Failed to send email:", str(e))
|
print("[*] Failed to send email:", str(e))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user