Ioannis,

This is really strange, yes. It took me hours to find out that there was something strange.

But actually, to make it work, I use:

working with PIC: SEROUT PORTB.4,2,["AT+CMGS=",34,"+4179xxxxxx",34,10,"Hello Roger",26,10,13]

working with serial com: AT+CMGS="+4179xxxxxxx"#10"Hello Roger"#26

If I replace the 10 or #10 by a 13 or #13, it will not work anymore.

Nope, no idea what's wrong but "yes", I'm sure I use LF instead of CR.