Bulk Messaging System

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

SMTP configuration

Introduction#

SMTP connection settings the main process expects, plus provider-specific defaults and how the UI persists a sanitized config.

Project structure#

The SMTP functionality is implemented in the Electron main process and exposed to the renderer via IPC. The key components are:

  • SMTP handler: creates transporters, verifies connections, sends emails, and manages progress events
  • SMTP form: collects SMTP configuration and email content from the user
  • Main process: registers IPC handlers and routes requests
  • Preload bridge: exposes secure IPC methods to the renderer

Core components#

  • SMTP configuration fields supported by the UI:
  • Host
  • Port
  • Username/Email
  • Password
  • Secure connection toggle (SSL/TLS)
  • SMTP handler behavior:
  • Validates presence of host, port, user, and pass
  • Optionally saves host, port, secure, and user to encrypted storage
  • Creates a Nodemailer transporter with host, port, secure, auth, and TLS options
  • Verifies the connection before sending
  • Sends emails sequentially with configurable delay between attempts
  • Emits progress events for each recipient
  • IPC exposure:
  • Renderer invokes “smtp-send” via preload bridge
  • Main process routes to handler
  • Handler returns results and errors

Architecture overview#

The SMTP workflow spans UI input, IPC routing, and the main process handler.

Detailed component analysis#

SMTP configuration parameters#

  • Host: SMTP server hostname or IP address
  • Port: Numeric port number
  • Username/Email: Sender identity used for authentication
  • Password: Credential for authentication
  • Secure connection: Boolean flag controlling SSL/TLS behavior

These fields are collected in the SMTP form and passed to the handler.

Transporter creation and security options#

  • Transporter options include host, port, secure, auth, and TLS
  • The secure flag is used to select SSL/TLS mode
  • TLS rejectUnauthorized is configured to accept self-signed certificates

Connection verification and retry behavior#

  • The handler performs a connection verification before sending
  • There is no explicit retry mechanism in the handler; failures are reported per recipient
  • The UI displays per-recipient status and error messages

Rate limiting and delays#

  • The handler applies a configurable delay between sending each email
  • Delay is passed in milliseconds and used to throttle requests

Authentication methods#

  • Username/password authentication is supported via the auth object
  • OAuth2 is supported for Gmail via a separate handler
  • API keys are not directly supported by the SMTP handler; use OAuth2 or username/password

Credential storage#

  • The handler can optionally persist host, port, secure, and user to encrypted storage
  • Password is not saved for security

Provider-Specific settings#

Provider-specific recommendations are documented in the project’s README. These include:

  • Gmail SMTP: host, port, and security guidance
  • Outlook SMTP: host, port, and security guidance

Use these values in the SMTP form fields.

Dependency analysis#

The SMTP handler relies on external libraries and Electron modules.

Performance considerations#

  • Sequential sending: Emails are sent one after another with a configurable delay
  • No connection pooling: The handler creates a single transporter and reuses it for verification and sending
  • Network timeouts: The handler does not set explicit timeouts; rely on underlying network defaults
  • Rate limiting: Use the delay setting to avoid throttling or rate limits

Troubleshooting guide#

Common SMTP issues and checks derived from the codebase:

  • Incomplete configuration: Ensure host, port, user, and pass are provided
  • Connection verification failure: The handler validates connectivity before sending
  • Self-signed certificates: TLS rejectUnauthorized is set to accept self-signed certs
  • Per-recipient failures: Errors are emitted per recipient via progress events

Operational tips:

  • Verify server settings and firewall rules
  • Confirm correct port and security mode
  • Use appropriate delays to avoid rate limits

Conclusion#

Verify the transport before a bulk run. Most provider failures are wrong port/TLS pairing or an app-password requirement you skipped.

Appendices#

Configuration templates#

Use these templates to quickly set up SMTP for common providers. Fill in the host, port, username/email, and password fields in the SMTP form.

  • Gmail SMTP

  • Host: smtp.gmail.com

  • Port: 587 (TLS) or 465 (SSL)

  • Security: Enable secure connection (SSL/TLS)

  • Authentication: Use App Password (not regular password)

  • Outlook SMTP

  • Host: smtp-mail.outlook.com

  • Port: 587

  • Security: TLS

  • Authentication: Username/password

Security considerations#

  • Credential encryption: The handler can persist host, port, secure, and user to encrypted storage; password is not saved
  • Certificate validation: TLS rejectUnauthorized is set to accept self-signed certificates
  • Secure connection establishment: Use the secure connection toggle to enable SSL/TLS as required by your provider