Pingram Email
Pingram provides complete email infrastructure: outbound sending, inbound receiving, custom domains, and SMTP relay.
Outbound Email
Sending Emails
await client.send({
type: 'welcome',
to: { email: 'user@example.com' },
email: {
subject: 'Welcome to Our App',
html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
senderName: 'Acme Team',
senderEmail: 'hello@acme.com',
previewText: 'Thanks for signing up'
}
});
Note: The id field in to is optional. If your system tracks users by ID, include it. Otherwise, email alone is sufficient and will also serve as the user identifier.
Debugging: Check the API response for errors. For delivery issues, use Dashboard > Logs to see the full message lifecycle.
Email Options
await client.send({
type: 'invoice',
to: { email: 'user@example.com' },
email: {
subject: 'Your Invoice',
html: '<p>Please find your invoice attached.</p>',
senderName: 'Billing Team',
senderEmail: 'billing@yourcompany.com'
},
options: {
email: {
replyToAddresses: ['support@yourcompany.com'],
ccAddresses: ['manager@yourcompany.com'],
bccAddresses: ['archive@yourcompany.com'],
attachments: [
{
filename: 'invoice.pdf',
url: 'https://storage.example.com/invoice.pdf'
},
{
filename: 'terms.txt',
content: 'base64content...',
contentType: 'text/plain'
}
]
}
}
});
Attachment Options
URL-based attachments:
attachments: [
{ filename: 'report.pdf', url: 'https://example.com/report.pdf' }
];
Content-based attachments:
attachments: [
{
filename: 'data.csv',
content: 'base64encodedcontent',
contentType: 'text/csv'
}
];
Size limits
- Inline (
content):4 MB raw per attachment (6 MB total request payload after base64 and JSON overhead). Returns 413 when exceeded. Works via API and SMTP. - URL (
url): Up to 20 MB per attachment. API only — not available via SMTP. - For files over ~4 MB, use a URL attachment via the API.
Custom Domains
Why Use a Custom Domain?
- Better deliverability: Emails from your domain are less likely to be marked as spam
- Brand consistency: Send from
notifications@yourcompany.cominstead of a shared domain - Inbound email: Receive replies at your domain
Setting Up a Custom Domain
- Go to Settings > Domains in the Pingram dashboard
- Add your domain (e.g.,
yourcompany.com) - Copy the DNS records shown in the dashboard and add them to your DNS provider
Adding Email Senders
After domain verification, add sender addresses:
- Go to Settings > Senders
- Click Add Sender
- Enter the email address (e.g.,
notifications@yourcompany.com) - Set as default if desired
Inbound Email
Pingram can receive emails and forward them to your application via webhooks.
Default Inbox
Every account gets an inbox at yourcompany@mail.pingram.io. Configure a webhook to receive inbound emails.
Custom Domain Inbound
To receive emails at your custom domain:
- Verify your domain (see above)
- Go to Settings > Domains and enable inbound for your domain
- Add the MX record shown in the dashboard to your DNS provider
- Configure your inbound webhook in Settings > Webhooks
Inbound Webhook Payload
{
"eventType": "EMAIL_INBOUND",
"from": "customer@example.com",
"fromName": "John Doe",
"to": "support@yourcompany.com",
"cc": ["manager@yourcompany.com"],
"replyTo": "customer@example.com",
"subject": "Help needed",
"bodyText": "Plain text body",
"bodyHtml": "<p>HTML body</p>",
"attachments": [
{
"filename": "document.pdf",
"contentType": "application/pdf",
"size": 12345,
"content": "base64-encoded-content"
}
],
"messageId": "<unique-id@example.com>",
"inReplyTo": "<original-message-id>",
"references": "<thread-references>",
"receivedAt": "2024-01-15T10:30:00Z",
"trackingId": "019abc12-3456-7890-abcd-ef1234567890",
"userId": "customer@example.com",
"type": "support_inquiry"
}
SMTP Relay
Use Pingram as your SMTP server for sending emails from any application.
SMTP Credentials
Get your SMTP credentials from Settings > SMTP:
| Setting | Value |
|---|---|
| Host | smtp.pingram.io |
| Port | 587 (TLS) or 465 (SSL) |
| Username | type (e.g. auth_emails) |
| Password | Your API key |
Common Issues
First steps for any issue:
- Check the API response for error messages
- Go to Dashboard > Logs to see the full message lifecycle and status
- Verify your API key is valid
Email not delivered:
- Check Dashboard > Logs for delivery status and bounce details
- Verify the recipient address is valid
- Check if the domain is verified in Settings > Domains
Email going to spam:
- Ensure SPF, DKIM, and DMARC are configured (see Settings > Domains)
- Avoid spam trigger words in subject and body
- Include an unsubscribe link for marketing emails
Bounced emails:
- Hard bounce: Invalid address, remove from your list
- Soft bounce: Temporary issue, will retry automatically
- Check bounce reason in Dashboard > Logs