python import mailjet mailjet_api_key = 'YOUR_API_KEY' mailjet_api_secret = 'YOUR_API_SECRET' def send_mail(): mailjet_client = mailjet.Client(auth=(mailjet_api_key, mailjet_api_secret)) email_info = { 'FromEmail': 'sender@example.com', 'FromName': 'Sender Name', 'Subject': 'Test Email', 'Text-part': 'This is a test email.', 'Recipients': [{'Email': 'recipient@example.com'}] } result = mailjet_client.send.create(data=email_info) if result.status_code == 200: print('Email sent successfully!') else: print('Email sending failed. Error:', result.text) send_mail()


上一篇:
下一篇:
切换中文