Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dropped characters in "contact us" emails; characters replaced with "=" in order confirmation emails


Acetylene

Recommended Posts

Posted

Hi,

 

I'm having two possibly related errors.

 

On all emails sent to the store owner using the Contact Us form, the last character is dropped off.

 

Also, in the order confirmation emails, sometimes a single character will be replaced by "=" (example: This is =n exa=ple)

 

I think this is the relevant code:

 

// lets start with the email confirmation
 $email_order = STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($order->info['comments']) {
   $email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 $products_ordered . 
                 EMAIL_SEPARATOR . "\n";

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
   $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

 if ($order->content_type != 'virtual') {
   $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
                   EMAIL_SEPARATOR . "\n" .
                   tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
 }

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                 EMAIL_SEPARATOR . "\n" .
                 tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
 if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) { 
     $email_order .= $payment_class->email_footer . "\n\n";
   }
 }
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }

 

Please let me know where I should look to fix the problem. Also, if there is other code you need me to post, please let me know. Thank you!

Posted

Sorry for the double-post, but I realized it might help to post some of the actual email:

 

Payment Method=br>------------------------------------------------------

Cash on Deliv=ry

<br

 

This is how the email appears in our inbox. Thanks again!

Posted
Sorry for the double-post, but I realized it might help to post some of the actual email:

 

Payment Method=br>------------------------------------------------------

Cash on Deliv=ry

<br

 

This is how the email appears in our inbox. Thanks again!

Hmmmm... I've never heard of a problem like this is osc before, and the replaced characters don't seem to be consistent either... Could this perhaps be the email program on the backend (qmail, sendmail, etc)? Try editing your contact_us code and dumping a copy of the email text into a file, then send yourself an email via contact_us, and check what's dumped to that file against what actually got emailed...

 

Richard.

Richard Lindsey

Posted

I tried changing the email address I was using to send mail from, and that seemed to fix the Dropped characters in "contact us" emails, but not the = problem. Can anyone guide me further? Thanks!

Posted
I tried changing the email address I was using to send mail from, and that seemed to fix the Dropped characters in "contact us" emails, but not the = problem. Can anyone guide me further? Thanks!

Did you ever try dumping the email text to a file so you could verify whether it's the email text that's being sent corrupted, or whether the email-sending-software was corrupting it during the time it actually sends it?

 

Richard.

Richard Lindsey

Posted

I'm not sure how to do that... I'm just learning PHP. I installed a virgin oscommerce shop on the same server with the same email address, and that virgin site sent successfully. Does that help?

Posted

I disabled MIME HTML in emails and that seems to have fixed it for now. I do want to eventually have html emails but I can cross that bridge later. Now I have a new problem...but I am starting a new thread for it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...