How can I send bulk email without issue?

I am using Gmail premium account as SMTP for sending email from erp. Usually I’m sending mail for notifying customer. So, the number vary up to 500. When number is below 50 it works fine, whenever the recipient is above 50 I am getting: Invalid Outgoing Mail Server or Port

Here is how I am sending:

Following mail sending code is running inside a for loop.

frappe.enqueue(
                queue="short",
                method=frappe.sendmail,
                recipients=get_recipients(context.get('email')),
                sender=frappe.conf.bekredito['default_mail_sender'],
                subject=frappe.render_template(
                    email_template.subject, context),
                message=message,
                now=True,
            )

How can I resolve this issue?

Please check and read this Email Account
if you configured Email account correct or not

To fix this issue:

  1. Split Recipients: Send emails in smaller batches (e.g., 25-30 recipients per batch) to avoid Gmail’s limits.
  2. Check SMTP Settings: Ensure you’re using the correct Gmail SMTP settings:
  • Server: smtp.gmail.com
  • Port: 587 (TLS) or 465 (SSL)
  • Authentication: Gmail account credentials or App Password if 2FA is enabled.
  1. Use a Dedicated SMTP Service: For bulk emails, consider services like SMTPmart or Mailgun for better deliverability and higher limits.

To fix the issue, use services like DigitalAka or SMTPget for sending many emails. They work better for large numbers and avoid Gmail limits. Also, send emails in small batches instead of all at once.

To fix this, try using Mailgun and DigitalAka. It helps you send bulk emails easily, even to large lists, without running into issues like the one you’re facing with Gmail. It also tracks your emails and ensures they are delivered smoothly.

I’ve sent bulk emails many times, and here’s what works best for me:

:white_check_mark: Use a trusted SMTP like SMTPwire & WarmupSMTP
:white_check_mark: Warm up your domain first
:white_check_mark: Set up SPF, DKIM, and DMARC properly
:white_check_mark: Clean your email list — no spam traps or invalids
:white_check_mark: Keep the email content simple, no spammy words
:white_check_mark: Monitor inbox placement with tools like Mail-Tester

This setup helps me land in the inbox, not spam.