Jump to content
Latest News: (loading..)

lee the bean

Members
  • Content count

    63
  • Joined

  • Last visited

Profile Information

  • Real Name
    Lee Stevens

Recent Profile Visitors

6,493 profile views
  1. lee the bean

    Definitive PHPMailer Add-On / Instructions

    Looks like there has been a major update from v5.2, found legacy version here: https://github.com/PHPMailer/PHPMailer/tree/5.2-stable
  2. lee the bean

    Definitive PHPMailer Add-On / Instructions

    Thank you Gergely. The subtle code changes in email.php allowed PHPMailer class to function just perfectly. I can now proceed to update to PHP 5.6 So for anyone wanting a simple implementation guide here it is.... The Definitive PHPMailer Install Instructions My Store Store Owner My Company E-Mail Address my-email@mydomain.com E-Mail From my-email@my-domain.com Send Extra Order Emails To: my-email@my-domain.com E-Mail Options E-Mail Transport Method smtp E-Mail Linefeeds LF Use MIME HTML When Sending Emails true Verify E-Mail Addresses Through DNS true Send E-Mails true Download PHPMailer from https://github.com/PHPMailer/PHPMailer (current version 5.2.23) & upload to catalog/ext folder Backup email.php files Amend: admin/includes/classes/email.php & /includes/classes/email.php (these two files are identical) Replace (around lines 519), or replace your Pear code: if (EMAIL_TRANSPORT == 'smtp') { return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); } else { return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); } } With if (EMAIL_TRANSPORT == 'smtp') { // return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers)); // } else { // return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers)); // } // } require_once(DIR_FS_CATALOG . 'ext/PHPMailer/PHPMailerAutoload.php'); $pMail = new PHPMailer(); $pMail->IsSMTP(); $pMail->IsHTML(true); $pMail->Host = "mail.mydomain.com"; $pMail->SMTPAuth = true; $pMail->Username = "myemail@mydomain.com "; $pMail->Password = "mypassword"; $pMail->CharSet = "utf-8"; $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->addAddress($to_addr, $to_name); $pMail->Subject = $subject; $pMail->Body = $this->html; $pMail->AltBody = $this->text; if (!$pMail->Send()) { return false; } else { $pMail->clearAddresses(); $pMail->clearAttachments(); return true; } } } Replace host, username and password values with your Authenticated SMTP parameters. Now all auto-generated emails from oscommerce will be sent with HTML, with a from address of My Company <myemail@mydomwein.com> Emails sent via Tools -> Send Email, and newsletter emails will be send with HTML, with a from address of myemail@mydomwein.com. Once again, thank you Gergely.
  3. lee the bean

    Definitive PHPMailer Add-On / Instructions

    Thanks again. Sorry I thought I'd given all the info to save bouncing q's & a's. But I obviously haven't. Yes I need SMTP. Problem finding the definitive PHPMailer installation instructions is not really relevant to using sendmail. However in answer - problem finding the definitive PHPMailer installation instructions exists on my Windows WAMP server test bed, my live service and development environments - both Linux OS I simply need the 4 questions answered and guidance on what Install "PHPMailer for OsCommerce" as it is explained before means in some versions of online instructions.
  4. lee the bean

    Definitive PHPMailer Add-On / Instructions

    Thanks for that. I have been running OsC 2.3.4 since its release on PHP 5.3.28. That's not the issue as I have updated to PHP 5.5.38. Please re-read.
  5. Specification: HTTP Server: Apache/2.4.23 (Unix) PHP Version: 5.3.28 (Zend: 2.3.0) osCommerce: 2.3.4 Sending SMTP HTML enabled emails using Pear SMTP Authentication script via amended /includes/classes/email.php in front/backend My Store E-Mail Address my-email@mydomain.com E-Mail From My Company <my-email@my-domain.com> Send Extra Order Emails To: My Company <my-email@my-domain.com> E-Mail Options E-Mail Transport Method smtp E-Mail Linefeeds LF Use MIME HTML When Sending Emails true Verify E-Mail Addresses Through DNS true Send E-Mails true This configuration successfully sends all auto-generated emails and admin Send Emails and Newsletter Manager emails with HTML mark-up. I now need to update PHP version to 5.6. PEAR at PHP version 5.5.38 gives depreciated warnings: PHP Deprecated: Non-static method Mail::factory() PEAR at PHP version 5.6 fails to send emails with following error: PHP Strict Standards: Non-static method Mail::factory() PHP Strict Standards: Non-static method Mail_RFC822::parseAddressList() So time to look for alternative SMTP Authentication script and found several add-ons using PHPMailer. However they employ differing implementations. oscom-phpmailer4osc-smtp-with-authentication-ZaWWz-lQp7x 2006 PHPMailer from http://phpmailer.sourceforge.net (currently version 1.73) Includes class.phpmailer.php & class.smtp.php oscom-phpmailer-class-to-send-email-JqJxG-juVcE 2010 class.phpmailer.php version 5.1 sql database table update; backend/frontend class.phpmailer.php & class.smtp.php, updated application_top.php, general.php; backend mail.php, newsletter.php and product_notification.php oscom-phpmailer-for-oscommerce-X1ZFh-Wgg0V 2008 instruction only, amend backend/frontend configure.php replace lines that don’t exist in the file so add-on not valid. oscom-smtp-email-pX3Ou-aO1yH 2015 class.phpmailer.php version 5.2 backend/frontend email.php, class.phpmailer.php & class.smtp.php Current phpmailer.sourceforge.net is 5.2.23 (pre 5.2.18 has security vulnerability). It is unclear from the information within the add-on versions of class.phpmailer.php which versions they relate to from the original code on sourceforge. Many online instructions simply say install class.phpmailer.php (v5.2) or latest sourceforge version, add relevant code to email.php and configure Use MIME HTML When Sending Emails: false in E-Mail Options. Having tried the 2015 add-on (ie 2 x class.phpmailer.php, class.smtp.php and amended email.php) and the latest sourceforge 5.2.23 version (full folder files) I cannot get Tools -> Send Email to send a valid HTML email. Firstly I had to change My Store -> E-Mail From My Company <my-email@my-domain.com> to my-email@my-domain.com before any emails would send. With MIME HTML When Sending Emails: false no HTML is sent in message and received in outlook as: This is a heading 1 this is text this is heading 2 a little brown fox jumped over the hedge Text sent was: <h1>This is a heading 1</h1> this is text <h2>this is heading 2</h2> a little brown fox jumped over the hedge Properties X-MUNQ: aebac272d56eaa9b5c93265e7f828ecb X-MSK: HYD=0.517008005 Return-path: <my-email@my-domain.com> Envelope-to: my-email@my-domain.com Delivery-date: Wed, 12 Jul 2017 07:22:19 +0100 Received: from mail by mail.server.com with spamvirus-scanned (Exim 4.87) id 1dVB2R-0003Uz-0r for my-email@my-domain.com; Wed, 12 Jul 2017 07:22:19 +0100 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.server.com X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=HTML_MESSAGE, HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY shortcircuit=no autolearn=disabled version=3.3.1 Received: from mail.server.com ([IP.IP.IP.IP] helo=my-domain.com) by mail.server.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.87) id 1dVB2Q-0003TC-Tt for my-email@my-domain.com; Wed, 12 Jul 2017 07:22:18 +0100 Date: Wed, 12 Jul 2017 07:22:18 +0100 To: My Name <my-email@my-domain.com> From: my-email@my-domain.com Subject: mime off Message-ID: <3e57b978f06c6d5e5f4807cd120df6ac@my-domain.com> X-Mailer: PHPMailer 5.2.23 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.705, bases: 2017/07/12 01:47:00 #10048106; khse: 2014-01-23 rollback X-KLMS-AntiVirus-Status: Clean, skipped With MIME HTML When Sending Emails: true the email received in outlook as: --=_2a94c0d566e11ca9872b7af136e844f9 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit No error debug No error Errors are not cool --=_2a94c0d566e11ca9872b7af136e844f9 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable No error debug No error Errors = are not cool --=_2a94c0d566e11ca9872b7af136e844f9-- Text sent was: <h1>No error debug</h1> No error <h2>Errors are not cool</h2> Properties: X-MUNQ: e80dccd3256f0d6c51b84a9d5d3af320 X-MSK: HYD=0.528810005 Return-path: <my-email@my-domain.com> Envelope-to: my-email@my-domain.com Delivery-date: Mon, 10 Jul 2017 06:11:06 +0100 Received: from mail by mail.server.com with spamvirus-scanned (Exim 4.87) id 1dUQyQ-0000sK-9G for my-email@my-domain.com; Mon, 10 Jul 2017 06:11:06 +0100 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.server.com X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=HTML_MESSAGE, HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY,TVD_RCVD_IP shortcircuit=no autolearn=disabled version=3.3.1 Received: from mail.server.com ([IP.IP.IP.IP] helo=my-domain.com) by mail.server.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.87) id 1dUQyQ-0000pv-0O for my-email@my-domain.com; Mon, 10 Jul 2017 06:11:06 +0100 Date: Mon, 10 Jul 2017 06:11:18 +0100 To: My Name <my-email@my-domain.com> From: my-email@my-domain.com Subject: mime on Message-ID: <d3e199b6d34fb727e8f4bffa1725e982@my-domain.com> X-Mailer: PHPMailer 5.2.23 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.705, bases: 2017/07/10 00:40:00 #10018344; khse: 2014-01-23 rollback X-KLMS-AntiVirus-Status: Clean, skipped Longer messages are interspersed with equals signs (as seen in the h2 text). Longer messages with many HTML snippets completely screws up (technical term) the message body text. This is the code in email.php: require_once(DIR_FS_CATALOG . ext/PHPMailer/PHPMailerAutoload.php"); require_once(DIR_FS_CATALOG . "ext/PHPMailer/class.phpmailer.php"); $pMail = new PHPMailer(); $pMail->From = $from_addr; $pMail->FromName = $from_name; $pMail->IsSMTP(); $pMail->Host = "mail.my-domain.com"; $pMail->Username = " my-email@my-domain.com"; $pMail->Password = "mypassword"; $pMail->SMTPAuth = true; $pMail->Subject = $subject; $pMail->Body = $this->output; $pMail->AddAddress($to_addr, $to_name); $pMail->IsHTML(true); return $pMail->Send(); $pMail->ClearAddresses(); $pMail->ClearAttachments(); } Amending $pMail->IsHTML(false); makes no difference to received message ie. it is received in non-HTML followed by HTML in body of message. Here are my questions: 1. What is the definitive PHPMailer implementation? 2. What version of PHPMailer class from sourceforge is used in oscommerce v2.3.4? 3. Is the implementation simply class.phpmailer.php, class.smtp.php and code to email.php only? 4. Is the sourceforge PHPMailer class amended to function in oscommerce? I suspect there are other code changes I’ve not implemented as some instructions include the cryptic line: Install "PHPMailer for OsCommerce" as it is explained before. I have no idea what this related to. Having followed many forum entries I am no closer to understanding what is required. Response eagerly awaited and gratefully received.
  6. lee the bean

    PayPal App v4.039 - PayPal Standard bug

    I found the answer to the missing order email image - the order email is now also created in the file catalog/ext/modules/payment/paypal/standard_ipn.php - added code as above and the next order included the image as expected. However some emails are also created via catalog/includes/modules/payment/paypal_standard.php, so it would be nice to know in what circumstances the emails are generated from which of the two files, as both have for my site - which is setup only to use PayPal Standard checkout. The only possible explanation I can deduce is that a payment via a tablet/mobile device via a PayPal installed app uses different code to a PC device. Also could it explain why a trace of a payment had this during a checkout /shop/checkout_payment.php?error_message=Please+select+a+payment+method+for+your+order.&osCsid=58q8tesu4d33srpelbefbmpj22
  7. lee the bean

    PayPal App v4.039 - PayPal Standard bug

    ocCommerce v2.3.4 - PayPal App v4.039 Only one Payment module enabled - PayPal Payments Standard catalog/checkout_process.php & catalog/includes/modules/payment/paypal_standard.php modified to include store logo in email: // lets start with the email confirmation $email_order = tep_image(HTTPS_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'store_logo.png', STORE_NAME, 441, 44) . "\n\n" . STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . etc. This simple modification has been installed many years. PayPal App v4.039 has been installed, tested and live for a few months now without errors - it works a treat. However with two recent orders the extra order emails were missing the store logo image. No other indication that a problem may exist and no recent changes to coding. Decided to investigate and found the following in the server log on the last affected order: mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:24:15 +0000] "GET /shop/shopping_cart.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 200 44211 "https://www.mysite.com/shop/product_info.php?products_id=1164&osCsid=58q8tesu4d33srpelbefbmpj22" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:26:22 +0000] "POST /shop/checkout_shipping.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 302 - "https://www.mysite.com/shop/checkout_shipping.php?osCsid=58q8tesu4d33srpelbefbmpj22" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:26:23 +0000] "GET /shop/checkout_payment.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 200 31545 "https://www.mysite.com/shop/checkout_shipping.php?osCsid=58q8tesu4d33srpelbefbmpj22" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:35:15 +0000] "GET /shop/checkout_confirmation.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:35:21 +0000] "GET /shop/checkout_payment.php?error_message=Please+select+a+payment+method+for+your+order.&osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 200 31748 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:36:10 +0000] "POST /shop/checkout_confirmation.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 200 36588 "https://www.mysite.com/shop/checkout_payment.php?error_message=Please+select+a+payment+method+for+your+order.&osCsid=58q8tesu4d33srpelbefbmpj22" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:55:36 +0000] "GET /shop/checkout_process.php?osCsid=58q8tesu4d33srpelbefbmpj22&tx=08312084CR8405507&st=Completed&amt=91%2e55&cc=GBP&cm=1532&item_number= HTTP/1.1" 302 - "https://www.paypal.com/ca/cgi-bin/webscr?cmd=_flow&SESSION=TPPMEy2coLjMqGNnXfR4v46q3KVibDFC_k85uCXZmLkfzr3woX6SlZchQYm&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081984719xxxxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" mysite.com 69.xxx.xxx.74 - - [31/Oct/2015:21:55:38 +0000] "GET /shop/checkout_success.php?osCsid=58q8tesu4d33srpelbefbmpj22 HTTP/1.1" 200 36584 "https://www.paypal.com/ca/cgi-bin/webscr?cmd=_flow&SESSION=TPPMEy2coLjMqGNnXfR4v46q3KVibDFC_k85uCXZmLkfzr3woX6SlZchQYm&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b08198471xxxxxxxxxxxxxxxxx" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" As there is only one payment option - it is not selectable but the selected default, so it is not possible to not have the payment method not selected as per the error message appended to the checkout_payment.php url. Also - it is not possible to create the email without the image. So in this case the email is not being created from the two possible scripts paypal_standard.php (it should be this) or checkout_process.php (it would only be this if cash option was enabled). Hmmm. What the heck is going on. I cant reproduce the error message having extensively tested again. Thought I should report this to see if anyone else has seen this problem.
  8. lee the bean

    PayPal Standard not working after upgrading 2.3.3.4 to 2.3.4

    Hi Tejas, No - I had to backout the standard_ipn.php file. Have been waiting to see if I was alone with this problem, or if the developer had a comment / suggestion to make. Lee PS - Not sure why this topic was moved to add-ons - as this add-on upgrade is part of the 2.3.3.4 to 2.3.4 version update.
  9. lee the bean

    PayPal Standard not working after upgrading 2.3.3.4 to 2.3.4

    Addendum - Live site / PayPal also has the problem. The IPN has changed significantly post upgrade with many more parameters including parameters like &item_name (a list of all purchased products). Hmmm. Had to backout the PayPal Standard update (the only one I use). Doh...
  10. Post upgrade testing via sandbox - user pays at PayPal and is redirected back to site. However is redirected back to shopping cart with a pink error message Could not verify the PayPal transaction. Please try again. Order moves from Preparing [PayPal Standard] to Pending in admin orders and order details are: Date Added Customer Notified Status Comments 05/10/2014 22:12:00 PayPal [Transactions] PayPal IPN Verified [Transaction ID: 22P19020M5494511X; Completed (Unverified; £5.79)] However - no order emails are sent out neither is stock deducted nor checkout_success called. Any ideas?
  11. lee the bean

    PayPal IPN Module v1.1

    There are many known issues around PayPal IPN order processing. My store probably experiences an equal number of: 1. 'customer fails to pay at PayPal' orders (ie. changed mind etc) and leaving the order in the database to be deleted/cancelled, as 2. customer fails to return to checkout_process.php after payment and thus not completing the order processing (sending the order confirmation email, updating the stock database, updating best sellers etc). I prefer the logic of the v1.1 module as I would rather not do the order processing until payment has been completed, however this can leave the customer without an order confirmation email, and me without accurate stock figures for reasons outside my control (the known issues). Does anyone know of a utility that could be run to manually complete the order processing on the order (sending customer email, stock updating) once the PayPal account has been checked for successful payment? Many thanks Lee
  12. Adding the following code to the metatags.php removes all occurences of html text formatting and adds a space between words where required: After - $Description = $product_desc['products_description']; add these two lines $Description = str_replace('<br />', ' ', $Description); $Description = strip_tags($Description); Now these two simple to install, 'does what is says on the label' contributions work well together. I highly recommend them. Problem fixed.
  13. I've removed the fullpage plugin/settings in the categories.php and this has removed the html & head meta tags. Half the problem fixed. This leaves the following html text formatting in the product description: <!--l version="1.0" encoding="utf-8--><p align="justify"><font face="verdana,geneva"><font size="3"><strong>Title: </ etc Now for the easy meta tags contrib to work correctly all I need is a method of stripping the <> characters and all text between them out of the text strings. I had previously (prior to tinymce install) done a simple <br> removal thus: $Title = str_replace('<br>', ' ', $Title); and $Description = str_replace('<br>', ' ', $Description); is there a simple way of removing the html text formatting strings from the text string in the metatags.php file?
  14. I'm using the easy meata tags contrib http://addons.oscommerce.com/info/6360 which uses the first 150 chars of the product description as the meta description tag (and this works fine). I've just installed the tinymce editor contrb http://addons.oscommerce.com/info/5864 which allows html text editing in the categories script textarea (and this works fine). However the tinymce adds a whole lot of html to the textarea like: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Untitled document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body><p align="justify"><font face="verdana,geneva"><font size="3"><strong>Title: </strong> Where Title: is the first characters of the product description. Does anyone know how to either setup tinymce to NOT add the <html><head> waffle - OR strip this extra text out in the easy meta tags contrib with string substitutions? (dont the extra <html><head><body> tags in the textarea conflict with the html page construction in tyhe php scripting anyway?) I hope this makes sense! I'm a novice and always use the simplest contrib to do the simplest of tasks - and these 2 contribs are at my level. Many thanks in advance.
  15. lee the bean

    Meta Tags Contribution - how to remove <br> chars

    I've added two extra lines to remove the <br> chars from <TITLE> & <META NAME="description" CONTENT=" before line: return ($Title); add line: $Title = str_replace('<br>', ' ', $Title); and before line: return ($Description); add line: $Description = str_replace('<br>', ' ', $Description); There, that wasn't so difficult was it. Confidence growing by the hour....
×