Get SMTP Credentials
Retrieve SMTP credentials for direct email sending (paid tiers only)
Authentication
Account API Key required via Authorization: Bearer {api_key} header.
Tier Requirement
Paid tier required - SMTP access is available on Developer, Growth, and Enterprise tiers only.
curl -X GET https://api.daimon.email/v1/account/smtp \
-H "Authorization: Bearer dm_live_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o"import { DaimonClient } from 'daimon-email';
const client = new DaimonClient({
apiKey: 'dm_live_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o'
});
try {
const smtp = await client.account.getSmtp();
console.log(`Host: ${smtp.host}`);
console.log(`Port: ${smtp.port}`);
console.log(`Username: ${smtp.username}`);
console.log(`Password: ${smtp.password}`);
} catch (error) {
if (error.code === 'SMTP_REQUIRES_PAID') {
console.log('SMTP requires paid tier');
console.log('Upgrade:', error.upgradeContext.operator_action_url);
}
}from daimon_email import DaimonClient, DaimonError
client = DaimonClient(api_key='dm_live_7d8a9b0c1d2e3f4g5h6i7j8k9l0m1n2o')
try:
smtp = client.account.get_smtp()
print(f"Host: {smtp.host}")
print(f"Port: {smtp.port}")
print(f"Username: {smtp.username}")
print(f"Password: {smtp.password}")
except DaimonError as e:
if e.code == 'SMTP_REQUIRES_PAID':
print('SMTP requires paid tier')
print(f"Upgrade: {e.upgrade_context['operator_action_url']}")Response
{
"result": {
"host": "smtp.daimon.email",
"port": 587,
"username": "acc_def456",
"password": "smtp_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
},
"next_steps": [
"Configure your SMTP client with these credentials",
"Use STARTTLS on port 587 (TLS encryption required)",
"Send from any inbox address associated with your account",
"Sending limits apply - check GET /v1/account for daily/monthly quotas"
]
}{
"error": "SMTP_REQUIRES_PAID",
"message": "SMTP access requires a paid tier subscription",
"upgrade_context": {
"operator_action_url": "https://daimon.email/upgrade?token=eyJhbGc...",
"operator_action_label": "Upgrade to enable SMTP access",
"agent_script": "Tell your operator: I need SMTP access. Here's a direct upgrade link: https://daimon.email/upgrade?token=eyJhbGc..."
}
}Response Fields (Success)
hoststringSMTP server hostname: smtp.daimon.email
portnumberSMTP server port: 587 (STARTTLS required)
usernamestringSMTP username (your account ID)
passwordstringSMTP password (generated on first SMTP access, stable across requests)
SMTP Configuration
Nodemailer (Node.js)
import nodemailer from 'nodemailer';
const smtp = await client.account.getSmtp();
const transporter = nodemailer.createTransport({
host: smtp.host,
port: smtp.port,
secure: false, // Use STARTTLS
auth: {
user: smtp.username,
pass: smtp.password
}
});
await transporter.sendMail({
from: 'my-agent@daimon.email',
to: 'user@example.com',
subject: 'Hello via SMTP',
text: 'Sent using daimon.email SMTP credentials!'
});smtplib (Python)
import smtplib
from email.message import EmailMessage
smtp = client.account.get_smtp()
msg = EmailMessage()
msg['From'] = 'my-agent@daimon.email'
msg['To'] = 'user@example.com'
msg['Subject'] = 'Hello via SMTP'
msg.set_content('Sent using daimon.email SMTP credentials!')
with smtplib.SMTP(smtp.host, smtp.port) as server:
server.starttls()
server.login(smtp.username, smtp.password)
server.send_message(msg)Environment Variables
# Store credentials securely
SMTP_HOST=smtp.daimon.email
SMTP_PORT=587
SMTP_USERNAME=acc_def456
SMTP_PASSWORD=smtp_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6Important Notes
Warning
Sending limits apply: SMTP sends count against your daily and monthly quotas. Check GET /v1/account for current limits.
Info
From address validation: You can only send from inbox addresses that belong to your account. Attempting to send from unauthorized addresses will result in authentication failure.
Info
TLS required: Port 587 requires STARTTLS. Plain authentication is not supported. Port 465 (implicit TLS) is also supported.
Error Responses
401errorInvalid or missing API key
403errorSMTP access requires paid tier. Response includes upgrade_context.
Credential Rotation
SMTP passwords are stable but can be rotated by contacting support. After rotation, update all SMTP clients with the new credentials.
Related Endpoints
GET /v1/capabilities- Check if SMTP is available at your tierPOST /v1/upgrade-link- Generate upgrade link for SMTP accessGET /v1/account- View sending limits and usage