From 625a0e841260dd29ccce19f8b48755486ddacd93 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Mon, 22 Mar 2021 12:20:14 -0400 Subject: [PATCH] Email Test --- requirements.txt | 3 ++- tests/SendMail.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/SendMail.py diff --git a/requirements.txt b/requirements.txt index b4ec155..f49995a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,5 @@ setuptools~=54.0.0 ruamel.yaml qrcode Pillow -pyautogui \ No newline at end of file +pyautogui +selenium \ No newline at end of file diff --git a/tests/SendMail.py b/tests/SendMail.py new file mode 100644 index 0000000..b9444ff --- /dev/null +++ b/tests/SendMail.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +# Python Email Sending Test +# Author - HoneyMoose(huyuchengus@gmail.com) +# Link Article - https://www.ossez.com/t/python/13398 + +import requests + + +# MAILGUN API SEND MESSAGE +def mailgun_api_send_message(): + return requests.post( + "https://api.mailgun.net/v3/sandbox7955c7c533744fb28e650b72192eac87.mailgun.org", + auth=("api", "YOUR_API_KEY"), + data={"from": "OSSEZ ", + "to": ["huyuchengus@gmail.com"], + "subject": "Hello MailGun API", + "text": "Testing Sending mail by Mailgun API!"}) + + +if __name__ == "__main__": + for i in range(3): + print(mailgun_api_send_message().text)