Setup SMTP Keys
Generate SMTP credentials for connected email accounts to use with traditional email clients
Generate SMTP credentials to use your connected email accounts with traditional email libraries like Nodemailer, PHPMailer, or built-in SMTP clients.
SMTP Credentials: Use your connected Gmail/Outlook accounts with any SMTP-compatible email library or application.
Generate SMTP Credentials
Access SMTP Section
- Sign in to dash.keplars.com
- Navigate to SMTP Credentials in the sidebar
- Click Generate SMTP Credentials
Configure Credentials
- Select your connected email account
- Enter a descriptive name (e.g., "Production App")
- Click Generate
Save Credentials
Important: Copy your SMTP credentials immediately - they're shown only once.
- Copy the SMTP username and password
- Store them securely in your environment variables
- Click Done
Connection Settings
Use these settings with any SMTP client:
Host: smtp.keplars.com
Port: 587 (recommended - industry standard)
or 2525 (legacy - will be deprecated)
Security: STARTTLS
Username: [Your generated username]
Password: [Your generated password]Port 587 is the industry-standard SMTP submission port and is recommended for all new integrations. Port 2525 is supported for backward compatibility but will be deprecated in the future.
SMTP Capabilities & Limitations
SMTP vs API Features:
✅ SMTP Supports:
- Raw email content (subject, body, HTML)
- Custom sender display names (e.g.,
From: John Doe <[email protected]>) - Multiple recipients (To, CC, BCC)
- File attachments
- Custom headers
❌ SMTP Does NOT Support:
- Email templates - Templates are only available via the REST API
- Template parameters and dynamic content
- Advanced features like AI-generated content
When to use SMTP:
- Legacy applications that can't make HTTP requests
- Existing codebases using SMTP libraries
- Drop-in replacement for traditional SMTP servers
When to use the API:
- New integrations and modern applications
- When you need email templates
- Better error handling and debugging
- Advanced features and analytics
Code Examples
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransporter({
host: 'smtp.keplars.com',
port: 587,
secure: false, // Enable STARTTLS (upgrades connection to TLS)
auth: {
user: process.env.KEPLERS_SMTP_USERNAME,
pass: process.env.KEPLERS_SMTP_PASSWORD
}
});
async function sendEmail() {
await transporter.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Hello from Nodemailer',
text: 'This email was sent using SMTP credentials'
});
}
sendEmail()
.then(() => console.log('Email sent successfully'))
.catch(error => console.error('Error:', error));Install:
npm install nodemailerimport smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import os
# SMTP Configuration
smtp_username = os.getenv('KEPLERS_SMTP_USERNAME')
smtp_password = os.getenv('KEPLERS_SMTP_PASSWORD')
# Create message
message = MIMEMultipart()
message['From'] = '[email protected]'
message['To'] = '[email protected]'
message['Subject'] = 'Hello from Python'
body = 'This email was sent using SMTP credentials'
message.attach(MIMEText(body, 'plain'))
# Send email
try:
server = smtplib.SMTP('smtp.keplars.com', 587)
server.starttls() # Enable STARTTLS encryption
server.login(smtp_username, smtp_password)
server.send_message(message)
server.quit()
print('Email sent successfully')
except Exception as e:
print(f'Error: {e}')Note: smtplib is part of Python's standard library (built-in since Python 2.6), so no installation is required.
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
// Server settings
$mail->isSMTP();
$mail->Host = 'smtp.keplars.com';
$mail->SMTPAuth = true;
$mail->Username = getenv('KEPLERS_SMTP_USERNAME');
$mail->Password = getenv('KEPLERS_SMTP_PASSWORD');
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
// Recipients
$mail->setFrom('[email protected]');
$mail->addAddress('[email protected]');
// Content
$mail->isHTML(false);
$mail->Subject = 'Hello from PHPMailer';
$mail->Body = 'This email was sent using SMTP credentials';
$mail->send();
echo 'Email sent successfully';
} catch (Exception $e) {
echo "Error: {$mail->ErrorInfo}";
}
?>Install:
composer require phpmailer/phpmailerpackage main
import (
"fmt"
"net/smtp"
"os"
)
func main() {
// SMTP Configuration
smtpHost := "smtp.keplars.com"
smtpPort := "587"
username := os.Getenv("KEPLERS_SMTP_USERNAME")
password := os.Getenv("KEPLERS_SMTP_PASSWORD")
// Message
from := "[email protected]"
to := []string{"[email protected]"}
subject := "Subject: Hello from Go\n"
body := "This email was sent using SMTP credentials"
message := []byte(subject + "\n" + body)
// Authentication
auth := smtp.PlainAuth("", username, password, smtpHost)
// Send email with STARTTLS
err := smtp.SendMail(
smtpHost+":"+smtpPort,
auth,
from,
to,
message,
)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Println("Email sent successfully")
}Note: Go's smtp.SendMail automatically uses STARTTLS when available on port 587.
Understanding STARTTLS Security:
The secure: false setting (in Node.js/similar libraries) enables STARTTLS encryption, which is the recommended security method for port 587:
- Connection Flow: Starts as plaintext → Client sends
STARTTLScommand → Connection upgrades to TLS encryption → All data (credentials, emails) transmitted securely - Industry Standard: Port 587 with STARTTLS is the modern standard for email submission (RFC 6409)
- Not Insecure: Despite the name,
secure: falseenables encryption via STARTTLS upgrade
Alternative: secure: true (Port 465)
- Uses implicit TLS (connection encrypted from start)
- Legacy approach, less commonly used
- Keplers supports port 587 with STARTTLS only
Environment Variables
Store your credentials securely:
# .env file
KEPLERS_SMTP_USERNAME=your_generated_username
KEPLERS_SMTP_PASSWORD=your_generated_passwordManage Credentials
View Credentials
In your dashboard's SMTP Credentials section:
- View all your SMTP credentials
- Check usage statistics
- Monitor last activity
Update Credentials
- Edit: Change name or settings
- Deactivate: Temporarily disable
- Delete: Permanently remove
Security
Best Practices:
- Never commit SMTP credentials to code repositories
- Use environment variables
- Rotate credentials regularly
- Monitor usage for suspicious activity
Next Steps
- Send Emails - Learn about API-based email sending
- Examples - See SMTP integration examples for your language
- Webhooks - Get delivery notifications
Your SMTP credentials are ready. Use them with any SMTP-compatible email library to send emails through your connected accounts.