Bulk Messaging System

An Electron Desktop app for marketing campaign & broadcast management, using either whatsapp, gmail or a SMTP server

SMTP server configuration

Introduction#

Host, port, TLS/SSL, timeouts, and provider examples (Gmail, Outlook, and similar) for the SMTP form.

Project structure#

The SMTP functionality is implemented across several key components within the Electron application architecture:

Core components#

The SMTP configuration system consists of several interconnected components that work together to provide secure email delivery capabilities:

SMTP configuration form#

The user interface component allows users to configure SMTP server settings including host, port, username, password, and security options.

SMTP handler#

The backend handler manages the actual SMTP connection, authentication, and email sending process using Nodemailer.

IPC communication layer#

The Electron IPC system handles secure communication between the renderer process (UI) and main process (SMTP operations).

Architecture overview#

SMTP config layers:

Detailed component analysis#

SMTP configuration form component#

The SMTP form component is the UI for configuring email server settings:

SMTP handler implementation#

The SMTP handler manages the complete email sending process with reliable error handling and progress tracking:

IPC communication layer#

The Electron IPC system provides secure communication between the renderer and main processes:

Provider-Specific SMTP settings#

Gmail SMTP configuration#

Gmail requires specific configuration settings for secure SMTP access:

Setting Value Description
Host smtp.gmail.com Gmail SMTP server hostname
Port 587 (TLS) or 465 (SSL) Recommended port for Gmail
Security TLS/SSL Use TLS for port 587, SSL for port 465
Authentication App Password Use App Password instead of regular password

Outlook/Hotmail SMTP configuration#

Microsoft Outlook requires specific SMTP settings:

Setting Value Description
Host smtp-mail.outlook.com Outlook SMTP server hostname
Port 587 Standard port for Outlook SMTP
Security TLS Outlook requires TLS encryption
Authentication Standard Credentials Use username and password

Yahoo SMTP configuration#

Yahoo Mail requires specific SMTP configuration:

Setting Value Description
Host smtp.mail.yahoo.com Yahoo SMTP server hostname
Port 587 (TLS) or 465 (SSL) Recommended ports
Security TLS/SSL Use appropriate security protocol
Authentication Standard Credentials Use Yahoo account credentials

Custom SMTP server configuration#

For custom SMTP servers, the configuration follows standard patterns:

Setting Example Value Description
Host smtp.yourcompany.com Your SMTP server hostname
Port 587 Common SMTP port
Security TLS Recommended for security
Authentication Username/Password Standard SMTP authentication

Security configuration#

TLS/SSL configuration options#

SMTP security options the handler exposes:

Certificate validation settings#

The application provides certificate validation flexibility:

  • Certificate Validation. Disabled for self-signed certificates (rejectUnauthorized: false)
  • Custom CA Certificates. Can be pointed at a private CA
  • Hostname Verification. Server name verification for secure connections

Credential storage and security#

The application implements secure credential storage:

  • Encrypted Storage. SMTP credentials are stored securely using electron-store
  • Selective Storage. Host, port, and user are stored; passwords are not saved
  • Memory Management. Credentials are loaded only when needed

Connection and network requirements#

Firewall configuration#

SMTP connections require specific firewall configurations:

Network requirements#

The application requires:

  • Outbound Access. TCP connections to SMTP servers on configured ports
  • DNS Resolution. Ability to resolve SMTP server hostnames
  • Time Synchronization. Accurate system time for certificate validation
  • Proxy Support. Optional proxy configuration for restricted networks

Rate limiting and throttling#

The system implements intelligent rate limiting:

  • Default Delay. 1000ms between email sends
  • Configurable Delays. Users can adjust delay intervals
  • Provider Limits. Respects provider-specific sending limits
  • Backoff Strategies. Gradual increase in delays for failed attempts

Timeouts and retry mechanisms#

Connection timeouts#

The SMTP handler implements detailed timeout mechanisms:

Retry strategies#

The system employs progressive retry strategies:

  • Immediate Retry. First failure triggers immediate retry
  • Exponential Backoff. Subsequent failures use increasing delays
  • Maximum Attempts. Configurable maximum retry attempts
  • Error Classification. Different handling for different error types

Progress tracking#

Real-time progress tracking reports status:

  • Individual Email Status. Success/failure for each recipient
  • Overall Progress. Percentage completion indicator
  • Error Details. Specific error messages for failed attempts
  • Timing Information. Delivery timestamps and durations

Troubleshooting guide#

Common SMTP connection issues#

Authentication failures#

  • Symptoms. “Authentication failed” or “Invalid credentials”
  • Solutions.
    • Verify username/password combination
  • Check for App Password requirements (Gmail)
  • Ensure two-factor authentication settings are correct

Port blocking issues#

  • Symptoms. Connection timeouts or refused connections
  • Solutions.
    • Verify firewall allows outbound connections on configured port
  • Check with network administrator for blocked ports
  • Try alternative ports (587 vs 465)

Certificate validation errors#

  • Symptoms. “Certificate verification failed” errors
  • Solutions.
    • Check system date/time synchronization
  • Verify certificate chain validity
  • Point nodemailer at your private CA if you use one

DNS resolution problems#

  • Symptoms. “Host not found” or “DNS resolution failed”
  • Solutions.
    • Verify SMTP server hostname spelling
  • Test DNS resolution using command line tools
  • Check network connectivity and DNS server configuration

Network connectivity failures#

Proxy configuration issues#

  • Symptoms. Connection timeouts behind corporate firewalls
  • Solutions.
    • Configure proxy settings in network preferences
  • Verify proxy authentication requirements
  • Test proxy connectivity independently

ISP blocking issues#

  • Symptoms. Consistent connection failures to specific providers
  • Solutions.
    • Contact ISP to unblock SMTP ports
  • Use alternative SMTP providers
  • Configure SMTP over different ports

Performance and rate limiting issues#

Excessive rate limiting#

  • Symptoms. Slow sending speeds or frequent delays
  • Solutions.
    • Adjust delay settings in configuration
  • Reduce batch sizes for large mailing lists
  • Implement staggered sending schedules

Memory and resource issues#

  • Symptoms. Application slowdown or crashes during bulk sending
  • Solutions.
    • Monitor system resources during operation
  • Reduce concurrent connections
  • Optimize email content size

Configuration examples#

Gmail SMTP configuration example#

javascript
const gmailSMTPConfig = {
 host: "smtp.gmail.com",
 port: 587,
 secure: false, // Use TLS
 user: "[email protected]",
 pass: "your-app-password"
};

Outlook SMTP configuration example#

javascript
const outlookSMTPConfig = {
 host: "smtp-mail.outlook.com",
 port: 587,
 secure: true, // Use SSL
 user: "[email protected]",
 pass: "your-password"
};

Custom SMTP configuration example#

javascript
const customSMTPConfig = {
 host: "smtp.yourcompany.com",
 port: 587,
 secure: false, // Use TLS
 user: "[email protected]",
 pass: "your-password"
};

Enterprise SMTP configuration example#

javascript
const enterpriseSMTPConfig = {
 host: "smtp.internal.company.com",
 port: 465,
 secure: true,
 user: "[email protected]",
 pass: "enterprise-password",
 tls: {
 rejectUnauthorized: true,
 ca: ["path/to/certificate.pem"]
 }
};

Conclusion#

Copy provider host/port from their current docs, not from memory. App passwords and TLS ports change more often than this code does.