0

I am extracting the subject, sender and the body of a mail and sharing these to another application using outlook add-in. The payload looks like this:

var payload = 'Subject: ' + '\n'  + subject + '\n' +
            'Sender: ' + '\n'  + sender + '\n' +
            'Body: ' + '\n' + bodyContent + '\n' +
            'Additional Message: ' + '\n' + addMsg;

but the new line characters are not getting reflected properly. It is all in the same line.

1
  • Try using <br /> instead of \n? Commented Jul 10, 2023 at 6:50

1 Answer 1

0

This worked

var payload = `Subject:\n${subject}\n\nSender:\n${sender}\n\nBody:\n${bodyContent}\n\nAdditional Message:\n${addMsg}`;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.