python
import mailjet
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'
mj = mailjet.ApiClient(auth=(api_key, api_secret))
email = {
'FromEmail': 'sender@example.com',
'FromName': 'Sender',
'Subject': 'Test Email',
'Text-part': 'This is the content of the email.',
'Recipients': [{'Email': 'recipient@example.com'}]
}
result = mj.send.create(data=email)
if result.status_code == 200:
print('Email sent successfully!')
else:
print('Failed to send email. Error:', result.json())