400 error Send Mail

Im using SMTP relay as there are no limits on it, the API has a throttle of 1000 emails at a time I think.

Try leaving the port number default at 25 to test out.

Your username should just be : apikey and nothing else. For the password, It sounds like you’re maybe using the ‘API Key ID’ which is just an internal identifier. You need to use the apikey value itself as the password.

Frustratingly, you’ll only be able to see the full apikey once after you create it, so if you didn’t keep a copy of it, you’ll need to generate a new key.

Here’s what SendGrid say about it:

You will only be shown your API key one time. Please store it somewhere safe as we will not be able to retrieve or restore it.

There’s help here:

Post screenshots of your set up if you are still having issues.

@TMR Your efforts are appreciated, many thanks. I have been unable to base64 encode my SendGrid APIkey for TELNET tests. After too many days of trying I gave up. Sendinblue has an SMTP relay I just tried with no success there as well. { “status”: “500”, “code”: “EENVELOPE”, “message”: “Mail command failed: 501 Error: Bad sender address syntax”, “stack”: Begining to seem insurmountable.

Should anyone else struggle with the above, the simple fix is:

  1. Obtain a Gmail address
  2. enable 2FA
  3. Generate an App Password (as “allow less secure apps” is EOL)
  4. use smtp gmail com
  5. 465 SSL
  6. your@gmail com
  7. 16-digit app password

I hope this helps!

Is there a send limitation on Gmail using this approach?

Yes there is. It’s not a suitable method for any kind of mass mailing.

https://apps.google.com/supportwidget/articlehome?hl=en&article_url=https%3A%2F%2Fsupport.google.com%2Fa%2Fanswer%2F166852%3Fhl%3Den&assistant_id=generic-unu&product_context=166852&product_name=UnuFlow&trigger_context=a

1 Like

As an FYI for anyone considering gmail; Google will rewrite the From: header in all cases to contain the email address associated with the authenticated user. And strangely, it only rewrites the address segment of the header, leaving the personal name intact, creating headers with personal names and addresses that do not go together. But the sender email address will be obvious when you view the (gmail original message) email header.

Post Script: From a form-to-email perspective, there is no fix.

Can’t you use the Reply-To header to add the user’s e-mail address? :slight_smile: Kind of a workaround

So, when you go to reply, it’ll reply to the user’s e-mail address specified in that header

@apple; going to try right now. Many thanks!

1 Like

Yes, that works flawlessly – hit reply, and the appropriate email address fills the to: field. My issue, the form reply goes directly to my client without an email address from the sender, so I monitor the gmail account send field; check the original message then forward the email address. I appreciate your input, many thanks!