NYCPHP Meetup

NYPHP.org

[nycphp-talk] Strange ! and line break coming through via msyql/php/mail()

Rukbat rukbatsramblings at gmail.com
Fri Nov 18 10:58:24 EST 2011


Are you using a debugger (you should be).  Echo the email body into your 
debugger (not with echo statements, with whatever your debugger uses).  
If that doesn't give you a clue, write a little character_to_hex 
function and use that to sent the text to the debugger.  It's getting 
into the email somewhere (I assume you've tried different email clients 
to eliminate a buggy client as the problem), so debugging the body text 
should show you the bad text.  Then debug further back, one step at a 
time, and you should be able to find the line before the text gets 
corrupted and the line after.  That's where the corruption is occurring.

(If you've already done all that and still haven't found it, ignore me.)
> Greetings,
> I have a script that gets some text out of a MySQL table and sends it 
> in the message body via the mail function.  Some of the emails are 
> coming through with an exclamation point followed by the text being 
> moved to a new line.
> I'm not sure where this ! and \n are coming from.  When I view the 
> text in mysql, it's clean, there is no ! or \n.  If I output to the 
> browser with nl2br(), there is no ! or <br>.
> I've done some searching and haven't found any helpful info so I'm 
> appealing to you all.  Has anyone seen behavior like this, or have a 
> recommendation for what I can do to diagnose or fix the problem?
> I have a number of rows in the table.  Some of the them come through 
> clean on the email, and two come through with this mystery ! and line 
> break.  I've had the emails go to different accounts and viewed via 
> client or browser, and that doesn't make a difference.
> Thoughts?  Suggestions?
> Thanks,
> -Aaron
>
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/9e7f05dd/attachment.html>


More information about the talk mailing list