0

I have a document list configured for incoming email. I am using the EmailReceived event receiver and SPEmailMessage to parse the email and populate certain table fields.

For my 'body' field, I am using - item["Body"] = emailMessage.PlainTextBody;

When the email arrives, the data in the list appears as sent, with line breaks, etc.

However I now have a workflow that takes that incoming email and creates a new list object in another list using that data.

In my workflow (created with SP Designer), I say the Body field in List2 should equal currentItem:Body. Expecting it just copies the same data across.

What happens though, it copies the text but removes all the line breaks, so it's now all in one line.

I came across this similar issue - SharePoint 2010 workflow losing line breaks when copying to another list - but it didnt make much sense to me.

How can I ensure that both fields are 'rich text' fields in the lists? I added them via the UI in SharePoint 2013.

Thanks!

1 Answer 1

0

Ok, it was a little strange.

So using item["Body"] = emailMessage.PlainTextBody; produces the field and text to appear 'normal' in your list. With line breaks and all. But I lost those line breakers when copying that data to another field.

So I tried using item["Body"] = emailMessage.HTMLBody;. But now the data in my field looks terrible because shows all the HTML tags everywhere, HOWEVER, copying that data to a new field produces the desired formatted result.

Which is fine for me. :)

So what I have is an 'incoming Email library' list, which when email gets received is 'dumped/duplicated' into a general email item list, which includes outgoing emails. So although the data now is not all that readable in the original list, it is how I want it in my second list.

Hope this helps someone else, too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.