├── LICENSE ├── README.md └── index.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Plus Five Five, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Resend with Python 2 | 3 | This example shows how to use Resend with [Python](https://www.python.org). 4 | 5 | ## Prerequisites 6 | 7 | To get the most out of this guide, you’ll need to: 8 | 9 | * [Create an API key](https://resend.com/api-keys) 10 | * [Verify your domain](https://resend.com/domains) 11 | 12 | ## Installation 13 | 14 | Get the [Resend Python SDK](https://github.com/resendlabs/resend-python). 15 | 16 | ```sh 17 | pip install resend 18 | ``` 19 | 20 | ## Instructions 21 | 22 | 1. Define the `RESEND_API_KEY` environment variable using your API key. 23 | 24 | 2. Execute the following command: 25 | 26 | ```sh 27 | python3 index.py 28 | ``` 29 | 30 | ## License 31 | 32 | MIT License 33 | -------------------------------------------------------------------------------- /index.py: -------------------------------------------------------------------------------- 1 | import os 2 | import resend 3 | 4 | resend.api_key = os.environ["RESEND_API_KEY"] 5 | 6 | params = { 7 | "from": "Acme ", 8 | "to": ["delivered@resend.dev"], 9 | "subject": "Hello world", 10 | "html": "It works!" 11 | } 12 | 13 | email = resend.Emails.send(params) 14 | print(email) 15 | --------------------------------------------------------------------------------