Email.send() leads to Junk Email folder

I have had 2 identical mails (basically a mail that uses a Marketing Mailing template as html_body) being sent out with the method Email.send() and the method Message.send().

It seemes like Email.send() is not a god option anymore. Every mail I send with that method ends up in the Junk email folder in my Outlook. Message.send() works does not but need as ticket.

Email e;
e.setValue("subject", subject);
e.setValue("bodyHtml", htmlBody);
e.setValue("body", body);
e.setValue("to", to);
e.setValue("from", from);

Message ms;
ms.setValue("bodyHtml", htmlBody);
ms.setValue("body", body);
ms.setValue("ticketId", ticketId.toString()); 
ms.setValue("slevel", "2"); 
ms.setValue("createdBy", createdBy);
ms.setValue("author", u.getValue("username"));
ms.setValue("type", "1");
Integer msId ="Function SendReplyTemplate() have saved this message");
Vector v_to;
v_to.parseString(to, ",");
Vector v_cc;
v_cc.parseString(cc, ",");
Vector v_bcc;
v_bcc.parseString(bcc, ",");
ms.send(v_to, v_cc, v_bcc, subject);  //LEADS TO INBOX. 

How come? It did not use to be like this? 

And what method to use to script so the mail is sent through the marketing module instead so links can be measured?

RE: Email.send() leads to Junk Email folder

The first thing you should compare and analyze are the mail-headers in the two mails.

Often you can see the reason for why a certain email have gotten rated as spam, and in which step, etc.

I assume that both methods use the same SMTP-server, which should result in the same SPF-rating.

If DKIM is enabled, also this should be handled in the same way, but this could be verified by looking in the mailheader.

Also check if both email are the same when it comes to content, like existing subject text and body text, etc.

Af: Marcus Svenningsson 25. nov 2020

RE: Email.send() leads to Junk Email folder

This is interesting. We might have seen something similar, not entirely sure. Have had some weird Junk Mail issues in a case recently and think we used Email.send there.

Af: Frode Lillerud 26. nov 2020

RE: Email.send() leads to Junk Email folder

I have been working on a script that sends out via Email.send() this week and have sent out loads of emails to a few different email clients without any problems. Though I used a Service reply template as the body, not a marketing mailing template.

Af: Espen Steen 27. nov 2020