Sending Email via SMTP

Send emails from any programming language or application using standard SMTP. This guide covers connection settings, credential creation, and code examples.

SMTP Settings

Setting Value
Host mail.cyberpersons.com
Port 587 (recommended) or 25
Security STARTTLS (required)
Authentication AUTH PLAIN or AUTH LOGIN
Username Your SMTP credential (e.g., smtp_a1b2c3d4e5f6)
Password Your SMTP credential password
Port 587 vs 25: Use port 587 (submission) for all new integrations. Port 25 is also supported but may be blocked by some ISPs and cloud providers.

Creating SMTP Credentials

  1. Log into your Email Dashboard
  2. Go to SMTP Credentials
  3. Click Create Credential
  4. Give it a name (e.g., “My App”) and click Generate
  5. Copy the username and password — the password is only shown once!

Code Examples

Python (smtplib)

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart

msg = MIMEMultipart('alternative')
msg['From'] = '[email protected]'
msg['To'] = '[email protected]'
msg['Subject'] = 'Hello from CyberPanel'

text = 'Hello! This is a plain text version.'
html = '<h1>Hello!</h1><p>This is the HTML version.</p>'

msg.attach(MIMEText(text, 'plain'))
msg.attach(MIMEText(html, 'html'))

with smtplib.SMTP('mail.cyberpersons.com', 587) as server:
    server.starttls()
    server.login('smtp_YOUR_USERNAME', 'YOUR_PASSWORD')
    server.sendmail(msg['From'], [msg['To']], msg.as_string())

PHP (PHPMailer)

use PHPMailer\PHPMailer\PHPMailer;

$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'mail.cyberpersons.com';
$mail->SMTPAuth   = true;
$mail->Username   = 'smtp_YOUR_USERNAME';
$mail->Password   = 'YOUR_PASSWORD';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 587;

$mail->setFrom('[email protected]', 'Your Name');
$mail->addAddress('[email protected]');
$mail->Subject = 'Hello from CyberPanel';
$mail->isHTML(true);
$mail->Body = '<h1>Hello!</h1>';
$mail->AltBody = 'Hello!';

$mail->send();

Node.js (Nodemailer)

const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
  host: 'mail.cyberpersons.com',
  port: 587,
  secure: false, // STARTTLS
  auth: {
    user: 'smtp_YOUR_USERNAME',
    pass: 'YOUR_PASSWORD',
  },
});

await transporter.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello from CyberPanel',
  text: 'Hello!',
  html: '<h1>Hello!</h1>',
});

WordPress (WP Mail SMTP Plugin)

  1. Install and activate the WP Mail SMTP plugin
  2. Go to WP Mail SMTP → Settings
  3. Select Other SMTP as the mailer
  4. Enter:
    • SMTP Host: mail.cyberpersons.com
    • Encryption: TLS
    • SMTP Port: 587
    • SMTP Username: your credential username
    • SMTP Password: your credential password
  5. Click Save Settings, then use Email Test to verify

Common SMTP Errors

Error Cause Fix
535 Authentication failed Wrong username or password Double-check credentials; regenerate if needed
550 Domain not verified Sending from unverified domain Verify your domain
452 Rate limit exceeded Too many emails too quickly Slow down; check rate limits
Connection timeout Port blocked by ISP/firewall Try port 587; check firewall rules
SSL/TLS handshake error Missing STARTTLS Ensure STARTTLS is enabled (not SSL/TLS)

Related Guides

← Back to Documentation Hub

Table of Contents