pip install mailjet
python
import mailjet
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'
mailer = mailjet.Client(auth=(api_key, api_secret), version='v3.1')
email = {
'FromName': 'Sender Name',
'FromEmail': 'sender@example.com',
'Subject': 'Test Email',
'Text-part': 'This is the plain text content of the email.',
'Html-part': '<h1>This is the HTML content of the email.</h1>',
'Recipients': [{'Email': 'recipient@example.com'}]
}
response = mailer.send.create(data=email)
print(response.status_code)
print(response.json())