web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to insert a carriage return (or line feed) in smtp mail body?

(0) ShareShare
ReportReport
Posted on by 1,087

Hi,

i'm trying to send an email with a list of invoices. 

 

I need to insert a newline for each invoice number. 

I already tried \n and \r , but they don't seem to work. The string actually contains the carriage return, 

but the email body has got now carriage return once sent. 

 

Is there a particular way to do so?

 

Thank you in advance. 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Amiya Das Profile Picture
    205 on at

    Hi,

    try setting email format as html and then instead of \n\r put <br> .

    Regards,

    Amiya

  • vv1984 Profile Picture
    1,087 on at

    Thank you,

    it worked like a charm!

  • syed baber Profile Picture
    11,633 on at

    Hi,

    I have a same requirement. Can you please let me know how and where to set the format as html in code ?

    Thanks,

    Baber.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    It depends on which method you are using to send e-mails, since there are many.

    Some of them are covered in older posts, see here:

    stackoverflow.com/.../dynamics-ax-send-html-file-as-email

  • Martin Dráb Profile Picture
    238,147 Most Valuable Professional on at

    I don't think this question was about code, so you likely have a different problem (and what you described in your other thread is about XML, which is something completely different).

    If you're really trying to create emails in code, please create a new thread and explain it there, rather than trying to change the topic of this thread.

  • syed baber Profile Picture
    11,633 on at

    Hi Martin,

    That was a different requirement I explained in other thread which is about showing each error message on a separate line in an XML file. There is another requirement which is similar to this, where I need to send the email to specified email address contains error messages and each error message needs to be shown on separate line.

    Can you please let me know which method should I use ? I am using SysEmailSystemTable::sendMail method to send email in AX 2009.

    Thanks,

    Baber.

  • Martin Dráb Profile Picture
    238,147 Most Valuable Professional on at

    Please create a new thread for your question about how to send e-mails, give it appropriate title and tags and explain your problem there. Please don't change the topic of existing threads. Also notice that this thread has already been answered (years ago).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#2
TAHER Mehdi Profile Picture

TAHER Mehdi 3

#3
Nakul Profile Picture

Nakul 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans