If you do not want your spam sent via API to be marked as spam by Gmail, let’s see what the documentation says.
And there it says, and I paraphrase:
The Gmail Postmaster Tools provides senders with metrics for parameters such as reputation, spam rate, feedback loop, etc. This can help you verify compliance with the guidelines for Gmail bulk email senders, as well as identify problems with the spam filter.
I mean, here you see how you stand before the Alphabet.
Further down there is an important detail. My emphases:
The ratings of emails depend a lot on what is reported by users. Gmail users can mark or deselect messages as spam and move messages that are not spam between the Inbox tabs. In both cases, Gmail learns from user fixes and in time, automatically adjusts the rating according to user preferences.
In other words, it’s not enough to just do everything the way they direct it. If even following everything to the letter you annoy Gmail users, it is marked as spammer and period.
Moving forward, there are hints of what else can cause a message to be considered spam:
Authentication ensures that your messages are correctly classified. Emails without authentication are likely to be rejected or placed in the "Spam" folder, due to the high risk of being fake messages used in phishing scams.
Moreover:
The sender domain must pass the SPF or DKIM checks. Otherwise, the email may be marked as spam.
Your recipients must have previously agreed to receive your emails. Otherwise, if Alphabet finds out you didn’t follow this rule, your messages are spam and that’s it. Many spammers end up falling into the spam filter because of just this rule:
Each user on your distribution list should choose to receive your messages in one of the following ways:
- By means of an email requesting the subscription to your list.
- Manually marking a checkbox in a web form or software.
And yet:
To help ensure that your messages are not marked as spam, we also recommend that you:
- Automatically unsubscribe users whose email addresses reject multiple emails.
- Periodically send confirmation messages to users.
- Include every list of emails they’ve signed up to and offer the opportunity to unsubscribe from lists that users are no longer interested in.
And finally, a rule that’s hard to get around:
If your brand becomes associated with affiliate marketing spam, it may affect the emails you and your other affiliates send.
So you ask, why didn’t your email sent via SMTP go wrong? If I have to guess, it’s because the process of sending via SMTP can be more laborious for the sender, which is why the AI that checks your emails should think it’s a test or a "handmade" email (rather than mass/chain mail). From both professional and personal experience I can assure you that a system that sends many emails in this way - for any kind of messages, such as a system status, or SAC message exchange - ends up being marked as spam source faster than you are able to say "help", and recidivism takes account closure.
Destination links are from the same domain as the account that sends the email?
– Leandro Angelo
They are, all without exception
– Leonardo Bonetti
I did a test now, and when sending by SMTP it does not notify SPAM, when I send by GMAIL API yes
– Leonardo Bonetti
in sending by smpt you put the content-type as html or left only in html markup?
– Leandro Angelo
Saying that email marketing is not spam is like saying that water is not wet.
– Oralista de Sistemas
@Renan Spam is you send 300 million emails to the same person, insist on it... email marketing is not spam if you have a certain control over it
– Leonardo Bonetti
@Leandroangelo pus content type html certinho !
– Leonardo Bonetti
@Renan email marketing is not SPAM when the recipient agreed to receive when signed up to the sender under notice that this could happen, and that in the message contains an exclusion link (opt-out).
– Sam
@dvd I understand the legality and lawfulness of the web/click wrap, but my opinion on electronic membership contract is the same as Neil Gaiman’s: even Satan could not be as cunning as the people who do it.
– Oralista de Sistemas
@Renan Yeah, but that’s how it works.
– Sam