Zen Cart Logo
Forums / General Questions / Curious characters in confirmation emails

Curious characters in confirmation emails

Locked

Views: 2,340

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
31 Aug 2007, 2:49 PM
#1
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Curious characters in confirmation emails

Hi,

I'm set up to receive a copy of all order confirmation emails sent to my customers (in HTML format.) I just got one that has some odd characters added in odd places. I'd like to know where these are coming from so I can clean the emails up. (I haven't edited the email templates beyond adding my logo, so these are essentially stock Zen cart emails.)

  • At the top of the list of products ordered, just below the word Products, is a line starting with "!" and otherwise blank. (The quote marks and color here are just for clarity -- they don't appear in the emails.)

  • The fourth product ordered has the quantity shown as "6! " where all others show as "6" or some other appropriate number.

  • The eighth product listed shows this for quantity: "6&n bsp;".

  • The 15th product ordered shows the dollar value in non-bold text, where all others show the value in bold.

That was all from the latest order. In the previous order I see this "$! 9.750" and this "$9! .750" in the totals, as well as a bunch of totals that are fine. And I also see the top line with the "!". But in the order just previous to that I see no problems at all.

I suppose it's possible for the customer to type in an accidental ! after the 6, even though that's several keys away on the keyboard. But I've no idea how they could (or why they would) type in the non-breaking space code. And I don't think there's anything a customer can do that would cause one total to be not bold, or would cause totals to include exclamation points or spaces, since totals are calculated by Zen Cart.

In short, I can't imagine where these oddities are coming from. Perhaps someone here has seen them before and debugged them?

TIA

Rob

3 Sep 2007, 1:38 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Curious characters in confirmation emails

More details of the problem, from a test order I placed. There continue to be odd nbsp codes and odd exclamation points placed within the data of the order confirmation emails, in HTML format.

Here, from my email program's View Raw Source, is the top row of data from the products section of the email...

 <div class="order-detail-area"><table class="product-details" border="0" width="100%" cellspacing="0" cellpadding="2"><tr><td class="product-details" align="right" valign="top" width="30">6 x</td><td class="product-details" valign="top">And All the Trumpets Sounded (001) <nobr><small><em> </em></small></nobr></td><td class="product-details-num" valign="top" align="right">$9.750</td></tr>

You can see that the first line starts with "6 x" where it should say just "6".

Further down the exclamation points appear within the html code itself, as in...

<td class="product-details-num" valign="top" align="ri!
 ght">$9.750</td></tr><tr><td class="product-details" align="ri!
 ght" val
ign="top" width="30">6 x</td>

There are several of those, and as you might expect they mess up the alignment of the emails. The code appears just as you see it above, with those odd line endings presumably part of the problem.

If you can help debug this, create an account using the company name Testy (so I won't get excited by the order) and order a bunch of products (minimum 6 of each), then examine the order confirmation you get.

TIA

Rob

6 Sep 2007, 12:05 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Once in a while I would run into the same problem, would love to know if some of you guys have a suggestion.

6 Sep 2007, 12:40 AM
#4
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Rob,
Looks very much like mail system line breaks inserted into the mail to meet the various RFC specs that are not being decoded correctlyon receipt.
(Which is not to say that they were encoded correctly in the first place).

If you look at the source header, what encoding is specified there, and ditto at the start of the HTML section?
It's also possible for it to be a character set problem, but unlikely. Note that no message characters are lost, so these are insertions, not deletions or replacements.

6 Sep 2007, 1:22 AM
#5
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Rob, could you post what email transport your site is et to in admin-config-email options please.

The reason you're getting the problem on larger orders is that there is a 998 character line length limit in the mail standards. With certain setups, if you exceed that you get nasty characters inserted, most notably exclamation space....

I suspect it may be tied in with another issue I've been looking at, which is that in addition to Unix/Linux and Windows using different end of line characters, the standards for sendmail in certain modes and SMTP are also different. This may be compounding your problem. e.g. the particular setup expects carriage return line feed end of lines, but you're sending only linefeed. No EOL recognised.

Rgds,

Chuck

6 Sep 2007, 11:40 AM
#6
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Hi Chuck,

Thanks for taking an interest.

The email transport setting is PHP, probably because it's the default.

Here, I think, is the relevant part from the header...
Mime-Version: 1.0
X-Mailer: PHPMailer [version 1.73] via Zen Cart
Content-Type: multipart/alternative; boundary=b1_8242117acb3b9caa57e7aff14ccccb7d

...and here from the start of the html...
--b1_8242117acb3b9caa57e7aff14ccccb7d
Content-Type: text/plain; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit

And here is the server info, just in case...
Server OS: Linux 2.6.9-023stab043.1-enterprise
Database: MySQL 3.23.58
PHP Version: 4.3.11 (Zend: 1.3.0)
HTTP Server: Apache/2.0.51 (Fedora)

Hope that all means something to you. :blink:

Rob

6 Sep 2007, 8:32 PM
#7
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Thanks Rob, (And I REALLY mean that because you've just confirmed something I saw only once months ago and I've been trying to reproduce it!!!)

And no, the forum system didn't add those exclamation marks.

Nothing wrong with PHP as a mail transport setting, it's as default as you can get. The funny I'm referring to is that the MIME header is stating that your HTML message is plain text, instead of text/html. This would definitely cause the 998 character problem I referred to, as plain text messages can be expected to have linefeeds and carriage returns in them. HTML not so.

I'll get back with a solution, but in the meantime could you post the rest of your email options settings please. Not email addresses etc, just the admin type ones - use mime, known domain etc etc.

Rgds,

6 Sep 2007, 8:34 PM
#8
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Curious characters in confirmation emails

And as a piece of useless information, the characters being inserted - exclamation space (! ) seems to be some sort of wierd control sequence - type it into Google and hit enter.

6 Sep 2007, 9:02 PM
#9
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Curious characters in confirmation emails

Here's my email settings, under configuration...

E-Mail Transport Method PHP
E-Mail Linefeeds LF Info
Use MIME HTML When Sending Emails true Info
Send E-Mails true Info
Verify E-Mail Addresses Through DNS false Info
Email Archiving Active? true Info
E-Mail Friendly-Errors false Info
Email Address (Displayed to Contact you) [email protected] Info
Email Address (sent FROM) [email protected] Info
Emails must send from known domain? Yes Info
Email Admin Format? HTML Info
Send Copy of Order Confirmation Emails To [email protected] Info
Send Copy of Create Account Emails To - Status 1 Info
Send Copy of Create Account Emails To [email protected] Info
Send Copy of Tell a Friend Emails To - Status 0 Info
Send Copy of Tell a Friend Emails To [email protected] Info
Send Copy of Customer GV Send Emails To - Status 0 Info
Send Copy of Customer GV Send Emails To [email protected] Info
Send Copy of Admin GV Mail Emails To - Status 0 Info
Send Copy of Customer Admin GV Mail Emails To [email protected] Info
Send Copy of Admin Discount Coupon Mail Emails To - Status 0 Info
Send Copy of Customer Admin Discount Coupon Mail Emails To [email protected] Info
Send Copy of Admin Orders Status Emails To - Status 0 Info
Send Copy of Admin Orders Status Emails To [email protected] Info
Send Notice of Pending Reviews Emails To - Status 0 Info
Send Notice of Pending Reviews Emails To [email protected] Info
Set "Contact Us" Email Dropdown List Info
Allow Guest To Tell A Friend false Info
Contact Us - Show Store Name and Address 1 Info
Send Low Stock Emails 0 Info
Send Low Stock Emails To [email protected] Info
Display "Newsletter Unsubscribe" Link? false Info
Audience-Select Count Display false Info
SMTP Email Account Mailbox YourEmailAccountNameHere Info
SMTP Email Account Password YourPasswordHere Info
SMTP Email Mail Host mail.EnterYourDomain.com Info
SMTP Email Mail Server Port 25 Info
Convert currencies for Text emails £,£:€,€

Hope that fills yer boots.:D And thanks for helping. (I could of course just turn off html emails, but I know many people prefer them. Hah!)

Rob

13 Sep 2007, 3:45 PM
#10
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Curious characters in confirmation emails

For those who might be followiing this thread, the problem has been traced to an "issue" with the phpMailer code. If you're having the same problem, you can PM me for further details.

Rob