Keep Bold format in Text

Hi,

I get mail like this:

and need to resend new mails for each text between lines.

My problem is how to preserve Bold formatting from the original text.

Any suggestions?
Kind regards, Vanja

Hi @VanjaV

I would just like to get a little more clarity on your question. Are you saying that you are going to extract the text from the mail, and then split it into an array for every “----------” occurrence, and once done that, you are going to send an email response?

If that is true, why do you need to preserve the original bold text?

I would simply send an email out for each text message between the lines, and in my response use HTML body and in that body say <strong>{bold text}</strong> with the response and always make sure the IsBodyHtml = True. Or do you need to quote the original message first and then respond to it?

Thanks

hi
@VanjaV
try reading the header of the email and fetch the mailbody in html from the email header.
MailMessage.Headers[“HTMLBody”]
(Assuming that the email is send as HTML body)
the above will help you identify the bold parts (basically anyhing between “tag bold” is the text you need to extract", you can easily pull it with regex..
then while resending the email build you mailbody and add this extracted text with BOLD html tags.

regards
SG.

Hi @JarrydScott

I need to resend each text between lines as one mail.
So in this case 4 different mails, each one with only text between lines.

The real case is actually broader, here it is only for simplification purpose.

Thx. KR, Vanja

Ok I replicated it for you.

You are going to use the: your_emailvariable.BodyAsHTML header in your splitting as below:

Then when you send it for each text message, you do this:

This is the result email sent in Outlook:

Let me know if this helps :slight_smile: