Email Service
Mailgun is an email service API for sending, receiving, and tracking emails programmatically.
import requests
api_key = 'YOUR_API_KEY'
domain = 'YOUR_DOMAIN_NAME'
response = requests.post(
f"https://api.mailgun.net/v3/{domain}/messages",
auth=("api", api_key),
data={
"from": f"Sender <mailgun@{domain}>",
"to": ["recipient@example.com"],
"subject": "Hello from Mailgun",
"text": "This is a test email sent using Mailgun API."
}
)
print(response.status_code)
print(response.json())Last 50 checks (10 min intervals)