NYCPHP Meetup

NYPHP.org

[nycphp-talk] Botched email header

Jeff jsiegel1 at optonline.net
Thu Jul 24 12:32:01 EDT 2003


Someone suggested the possibility of using "addslashes" but I wouldn't
want the email header to 
say "Jay\'s Auto Wrecking." Stripping out the apostrophe leaves us with
"Jays Auto Wrecking" which isn't the company name. I thought of,
perhaps, htmlspecialchars but I'm not sure if that will introduce more
problems for if the email header has a problem with ' representing
an apostrophe/single quote.

Jeff

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of evcoen at earthlink.net
Sent: Thursday, July 24, 2003 10:44 AM
To: talk at lists.nyphp.org
Subject: RE: [nycphp-talk] Botched email header


I believe this will always happen with the code you list, if there's an
apostrophe in the company name. Before assigning a value to $companyName
you might try parsing the string: either stripping apostrophes or by
marking them as literal text.

-evc

Original Message:
-----------------
From: Jeff jsiegel1 at optonline.net
Date: Thu, 24 Jul 2003 11:23:10 -0400
To: talk at lists.nyphp.org
Subject: [nycphp-talk] Botched email header


Below is the header from a "botched" email (see the "FROM" line) and
below that is a snippet of code used to generate the header. Notice that
the second part of the "From" in the header has the correct email
address as does the Reply-To section of the header. It's probably the
apostrophe that's messing things up but I'm wondering what's the best
way to handle this. It should be noted (in case it is relevant to the
solution) that:
	a. magic_quotes is on (yes...I'm aware of the problems it
causes).
	b. the headers (along with the message body) get "bundled" into
an array, then get serialized and sent to another function which shoots
out the email.
	c. The FROM line *should* have said "From: Jay's Auto Wrecking
<mike at jaysauto.com>"

-Jeff
========================================================================

"ABNORMAL" headers:
From: Jay's.Auto.Wrecking at server1.uneedapart.com, "Inc."
<mike at jaysauto.com>
Reply-To: <mike at jaysauto.com>
X-Sender: <mike at jaysauto.com>
X-Mailer: PHP4
X-Priority: 1
Status:   
MIME-Version: 1.0


Code Snippet:

$sHeaders = "From: $sCompanyName
<{$_SESSION['srDU_sLoginEMailAddr']}>\n"
						."Reply-To:
<{$_SESSION['srDU_sLoginEMailAddr']}>\n"
						."X-Sender:
<{$_SESSION['srDU_sLoginEMailAddr']}>\n"
						."X-Mailer: PHP4\n"
						."X-Priority: 1\n"
						."Return-Path:
<{$_SESSION['srDU_sLoginEMailAddr']}>\n";


_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk




More information about the talk mailing list