youngan Posted March 6, 2006 Posted March 6, 2006 I keep getting garbage in my order receipt and order status change. Anyone else getting this and how can I fix it? Here is another... I'm using the phpMailer require_once(DIR_WS_CLASSES . "class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "mySMTP" // replaced with my smtp server $pMail->Username = "myUsername"; // replaced with mysmtp username (if SMTPAuth is true) $pMail->Password = "myPassword"; // replaced with mysmtp password (if SMTPAuth is true) $pMail->SMTPAuth = true; // true/false - turn on/off smtp authentication $pMail->Subject = $subject; $pMail->Body = $this->output; $pMail->AltBody = $this->output; $pMail->AddAddress($to_addr, $to_name); $pMail->AddReplyTo("[email protected]", "Picnic Basket Supply"); $pMail->WordWrap = 50; $pMail->IsHTML(true); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); Also, I'm using the email contribution EmailInv1_1. // lets start with the email confirmation if (EMAIL_INVOICE == 'true') { require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE); } else { $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 .= $order->info['comments'] . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0; $i<sizeof($order_totals); $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n\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, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); It's driving me crazy! It seems to be encoding wrong or something. Angie
youngan Posted March 7, 2006 Author Posted March 7, 2006 Found something interesting... It puts an equal sign and a space every 76 character. Manually changing the email output for testing to 01234567890123456789012345678901234567890123456789012345678901234567890123456789 0123456789 Gives me an "= " on the 76 character. I've added numbers and it is still every 76th. 012345678901234567890123456789012345678901234567890123456789012345678901234= 567890123456789 Any ideas?
kgt Posted March 7, 2006 Posted March 7, 2006 Encoding and all the caveats and standards of email are not my forte, but here's something that might be of interest. Read the bit about Quoted-Printable: http://www.livinginternet.com/e/eu_config.htm Following that, more on encoding: http://www.helpdesk.umd.edu/topics/email/protocols/315/ Try adding $pMail->Encoding='8bit'; to the 1st code file you posted. Contributions Discount Coupon Codes Donations
youngan Posted March 8, 2006 Author Posted March 8, 2006 That did the trick! Thank you for pointing me in the right direction. I tried 7bit, 8bit, and base64, and 7bit seemed to do the trick. I changed in admin/includes/classes/email.php and /includes/classes/email.php line 59 From: $this->build_params['html_encoding'] = 'quoted-printable'; To: $this->build_params['html_encoding'] = '7bit';
Recommended Posts
Archived
This topic is now archived and is closed to further replies.