cancel
Showing results for 
Search instead for 
Did you mean: 

HI, I use NDEF Email with X-NUCLEO-NFC04A1. I always read the NDEF Email content but I have a problem with the last version of gmail. the carriage returns are lose (see pictures) Do you know this problem ? Best Regards Mickaël

Mickaël Bucher
Associate II

0690X00000DXMuxQAH.jpg0690X00000DXMv2QAH.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee

Hi,

I have reproduced the issue with the last version of gmail. Using <br> seems to insert a line break with this new version of gmail, unfortunately with a previous version and with other mail apps it displays the <br> tag in the body. using %0D%0A isn't working in the last Gmail version too.

So this is something not correctly managed by the last Gmail app, you should report it if you want to use your NFC tag with different emails app.

Best Regards

View solution in original post

7 REPLIES 7
Rene Lenerve
ST Employee

Hi @Mickaël Bucher​ ,

In the NDEF email the new line is represented by the character 0x0A (New Line in ASCII code). it seems that Gmail is not correctly interpreting it. It could be the default email content type the cause. If it displays it as HTML (Content-type: text/html), should be changed to Content-type: text/plain.

Another test to see if your content is correctly formatted in the Tag is to use our ST25 NFC Tap Android Application and check if the email is correctly displayed.

Hope this can help you.

Best Regards.

Mickaël Bucher
Associate II

Hi @Rene Lenerve​ ,

I think my content is correctly formatted in the tag (see attachement).

I use ST25 NFC Tap Android an Gmail in the same smartphone.

0690X00000DYdhnQAD.jpg

I search but I don't find the option for change the content type in gmail (version 2020.02.02.294309273).

Do you know the procedure to change content type in gmail ?

Rene Lenerve
ST Employee

Hi @Mickaël Bucher​ ,

i'm not familiar with GMAIL, maybe something you can try is adding a carriage return (ASCII code 0x0D) after the new line (0x0A => 0x0A 0x0D) in the NDEF message, it could do the trick.

Best Regards.

Edit:

RFC 2368 (The mailto URL scheme) is more precise and requires using 0x0D 0x0A for line breaks in the body of the message.

Mickaël Bucher
Associate II

Hi @Rene Lenerve​ ,

I try add 0x0A 0x0D or 0x0D 0x0A (\n\r or \r\n) but the result is the same

Ulysses HERNIOSUS
ST Employee

Hi Mickaël,

reading https://stackoverflow.com/questions/22765834/insert-a-line-break-in-mailto-body

I would try to use "%0D%0A". You could also try to use "<br>".

This is also backed by https://www.ietf.org/rfc/rfc2368.txt section 5. This implies also using e.g. "%20" for " "(space).

Regards, Ulysses

Hi Ulysses,

Thanks for help.

I try %0D%0A , %0A%0D, <\n\r>, <\r\n> but the result is the same with gmail app.

I try other email app and I have not this problem.

Regards, Mickaël

Rene Lenerve
ST Employee

Hi,

I have reproduced the issue with the last version of gmail. Using <br> seems to insert a line break with this new version of gmail, unfortunately with a previous version and with other mail apps it displays the <br> tag in the body. using %0D%0A isn't working in the last Gmail version too.

So this is something not correctly managed by the last Gmail app, you should report it if you want to use your NFC tag with different emails app.

Best Regards