cancel
Showing results for 
Search instead for 
Did you mean: 

UDF content in mail

0 Kudos

Hi All,

I have a user defined field where user will enter his/her content in the field,this data has to be appeared in mail(Content/Body).

The problem is, the data which has been entered in the content field is been displayed in mail but not line by line.

The way how the user is entering the data in content field the same way it should appear in the mail i.e. line by line.

For eg:

UDF content I am entering is

1

2

3

4

The way the above data is appearing in mail is

1 2 3 4

If any one has an idea about this plz help me.

Thanks & Regards,

Shravya

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Maraju,

SAP B1 stores in the DB the newline as CHR(13) which is the carriage return charcode.

I'm guessing that you are writing it to a format which don't recognize this charcode as the charcode for newline, say html.

If this is the case, try str.Replace(Chr(13), "<BR>") or in other case, try change "<BR>" to the desired newline.

Best Regards,

VG

0 Kudos

Hi Vitor,

Thanks for your reply.

But I didn't understand what you are trying to tell.

Anyways I am posting my code.

Dim strBody As StringBuilder = New StringBuilder

            strBody.Append("<table>")

            strBody.Append("<tr>")

            strBody.Append("<td style='font-size: 14; font-weight: Regular;font-family:Calibri ;'>")

            strBody.Append("" & Content & "<br>")

            strBody.Append("</td>")

            strBody.Append("</tr>")

            strBody.Append("</table>")

            Message.Body = strBody.ToString

            Message.IsBodyHtml = True

            Message.BodyEncoding = System.Text.Encoding.UTF7

Please specify if there are any changes to make.

Former Member
0 Kudos

Hi Maraju,

Please try and change

Message.Body = strBody.ToString

to

Message.Body = strBody.Replace(Chr(13), "<BR>")

And see if it solves your issue.

Best regards,

VG


pedro_magueija
Active Contributor
0 Kudos

Hi Maraju,

It could be that the email is in HTML format. HTML does not show "new line" characters. You might want to replace every "new line" character on the content string by the "<br/>" tag.

This will only work if indeed the email is the HTML format.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

lol,

Simultaneous Response, similar thoughts

pedro_magueija
Active Contributor
0 Kudos

Hi Vitor,

Indeed .


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn