Send multi-page email (html + plaintext) in Dynamics CRM 2011?

I am sending emails to Dynamics CRM 2011 UR13 using my plugin with the following code:

// Create the e-mail message Email email = new Email { To = new ActivityParty[] { toParty }, From = new ActivityParty[] { fromParty }, RegardingObjectId = new EntityReference(new_la.EntityLogicalName, la.Id), Subject = emailsubject, Description = emailbody, // html-content DirectionCode = true }; var _emailId = service.Create(email); // Send the e-mail message SendEmailRequest sendEmailreq = new SendEmailRequest { EmailId = _emailId, TrackingToken = "", IssueSend = true }; 

E-mail is sent to the reciptient, however, the spam filter of the recipients of the mail servers is not happy, because the content is only html.

 X-Spam-Report: * 1.6 HTML_IMAGE_ONLY_24 BODY: HTML: images with 2000-2400 bytes of words * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.7 MIME_HTML_ONLY BODY: Message only has text/html MIME parts * 0.4 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag 

I want to minimize the risk that emails get stuck in our mail filters of our clients. Ideally, the email should be sent as multipart, i.e. both the text and the text / html part, but I cannot figure out how to determine the part of the plain text separately.

So the question is, is there a way to specify one html part and one text part of the email body?

+4
source share
2 answers

This is like for PHP , but the same logic should work for crm email, I would think

-1
source

You need to remove the header and footer.

 body.Substring(body.IndexOf("<p"), body.LastIndexOf("</p>") - body.IndexOf("<p")); 
-2
source

Source: https://habr.com/ru/post/1482564/


All Articles