Skip to content

Instantly share code, notes, and snippets.

@sendpulse
Last active July 25, 2023 04:36
Show Gist options
  • Save sendpulse/14d46e1459df740727a6 to your computer and use it in GitHub Desktop.
Save sendpulse/14d46e1459df740727a6 to your computer and use it in GitHub Desktop.
SendPulse SMTP API usage example
# 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