Last active
July 25, 2023 04:36
-
-
Save sendpulse/14d46e1459df740727a6 to your computer and use it in GitHub Desktop.
SendPulse SMTP API usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SendPulse's Python Library: https://github.com/sendpulse/sendpulse-rest-api-python | |
from pysendpulse import PySendPulse | |
if __name__ == "__main__": | |
TOKEN_STORAGE = 'memcached' | |
SPApiProxy = PySendPulse(REST_API_ID, REST_API_SECRET, TOKEN_STORAGE) | |
email = { | |
'subject': 'This is the test task from REST API', | |
'html': '<p>This is a test task from https://sendpulse.com/api REST API!</p>', | |
'text': 'This is a test task from https://sendpulse.com/api REST API!', | |
'from': {'name': 'John Doe', 'email': '[email protected]'}, | |
'to': [ | |
{'name': 'Jane Roe', 'email': '[email protected]'} | |
] | |
} | |
SPApiProxy.smtp_send_mail(email) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment