NYCPHP Meetup

NYPHP.org

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

Sasa Rakic - Gmail rakics at gmail.com
Thu Nov 17 22:11:04 EST 2011


Dear Aaron,

When form get submitted I am using in html email:

            <tr>

              <td>

                <strong>Questions comments</strong>

                <hr />

                <?php

                  $value = $item->getValue("questions_comments");

                  echo str_replace("\n","<br />",wordwrap($value));

                ?>

                <p></p>

              </td>

            </tr>   

Also you should be aware of ' sign, for example:

                             if (get_magic_quotes_gpc())

                             {

                                             $value  = stripslashes($value);

                             }

Best regards,

Sasa

 

 

From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Aaron Fischer
Sent: Friday, November 18, 2011 12:38 AM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] Strange ! and line break coming through via
msyql/php/mail()

 

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

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/431e134f/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/431e134f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: contact_us.php
Type: application/octet-stream
Size: 3783 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/431e134f/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/431e134f/attachment-0002.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20111118/431e134f/attachment-0003.html>


More information about the talk mailing list