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);
e.send(); //LEADS TO JUNK EMAIL
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 = ms.save("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?