Knowledge Essentials - 3Essentials Hosting

SMTP-auth support to OSCommerce

Article ID: 400

 Back to Search

To prevent use of 3Essentials network and servers from being used by spammers, 3Essentials requires SMTP-auth for all sending mail (see this KB for more detailed explanation of SMTP-auth and how it prevents spam: What is SMTP-auth?).   By default, OSCommerce utilizes PHP's built-in mail functions, however those functions do not support SMTP-auth.  However, an OScommerce add-on is available which does support SMTP-auth, and has been tested with OSCommerce v2.2 RC1.   The following gives instructions on installing that update in order to enable you to send emails using SMTP-auth from OSCommerce:

  1. DECIDE/CREATE MAIL USER: First, you'll need to decide on and create an email address from which you want all communications related to your OSCommerce store sent, for example shop@yourdomain.com or store@yourdomain.com or maybe orders@yourdomain.com or help@yourdomain.com.  Once you've decided on the email address, you need to CREATE that mail user.  The following KB article provides instructions for how to create a mail user (a.k.a. mailbox) on your domain via the control panel: How to create a mailbox.  Proceed to the next step once you've created that mail user.
  2. VERIFY IF INSTALLED: The next step will be to determine if this option has already been installed and enabled on your OSCommerce installation:
    • Logging into your OSCommerce admin section, and selecting the Email Options link.  You'll see several options like E-mail Transport Method, E-Mail Linefeeds, etc.  If the SMTP-auth add-on is installed and enabled, you will see these items under email options as well:
      • SMTP Server Host Address
      • SMTP Server EHLO / HELO Name
      • SMTP Server Port Number
      • SMTP Authentication Required
      • SMTP Authentication Username
      • SMTP Authentication Password
    • If you see ALL of these options, then it has already been installed.  You may find this if 3Essentials performed your OSCommerce v2.2 RC1 installation for you after 10/2007 as we have begun including this in installations we perform for customers.  If you see ALL of these options, it is installed, and you can skip to step 5: CONFIGUREING SMTP-AUTH OPTIONS.
    • If you do not see ALL of these options, you need to install by proceeding with next steps starting at step 3.  
  3. VERIFY COMPATIBILITY: 
    • The specific add-on/update is located on OScommerce's website at: http://www.oscommerce.com/community/contributions,901 and http://addons.oscommerce.com/info/901 . We have tested the 10/6/07 release listed on that site, and include it here as a download, as well as the following instructions for implementing it:  We've tested this add-on with OSCommerce v2.2 RC1, if you are using a different version, this add-on may or may not be compatible, it is up to you to review documentation on the add-on and perform your own testing to validate compatibility. 
  4. INSTALL SMTP-AUTH ADD-ON
    1. Download the add-on, either from the oscommerce link or from the download associated with this article.  The download provided here is the 10/6/07 version of the add-on, and the instructions provided here are for that version.  If you download another version from oscommerce's website, you should review and follow the readme/documentation provided with that version in case there are differences.
    2. Extract the downloaded zip file to your PC, you should find it includes the following directory structure and files:
      • \smtpauth
        • \catalog
          • \admin
            • \includes
              • \classes
                • email.php
                • class.smtp.php
          • \includes
            • \classes
              • email.php
              • class.smtp.php
    3. Make an FTP connection to your site, and navigate to your OScommerce folder.
    4. Make a backup copy of these files, where %oscommerce% = the directory you installed oscommerce to:
      • %oscommerce%/catalog/admin/includes/classes/email.php
      • %oscommerce%/catalog/includes/classes/email.php
      • make a "backup" by simply copying the file to something like email.php.original or email.php.bak
    5. Via FTP, upload the files you extracted to your PC to the corresponding locations in your site:
      • yourPC\smtpauth\catalog\admin\includes\classes\email.php should overwrite your website's %oscommerce%\catalog\admin\includes\classes\email.php
      • yourPC\smtpauth\catalog\admin\includes\classes\class.smtp.php should go to your website's %oscommerce%\catalog\admin\includes\classes\class.smtp.php
        • the class.smtp.php file doesn't exist in the oscommerce installation by default, so you're not overwriting an exising copy of the file.
      • yourPC\smtpauth\catalog\includes\classes\email.php should overwrite your website's %oscommerce%\catalog\includes\classes\email.php
      • yourPC\smtpauth\catalog\includes\classes\class.smtp.php should go to your website's %oscommerce%\catalog\includes\classes\class.smtp.php
        • the class.smtp.php file doesn't exist in the oscommerce installation by default, so you're not overwriting an exising copy of the file.
    6. The next step, you'll execute some SQL commands against your OSCommerce database which will put new configuration options into your OScommerce database to support the SMTP-auth features.  You can either do this yourself, or if you're not comfortable with it, you can submit a support request for our support staff to do this for you.
      • To do yourself, connect to the database using the DBWebAdmin functions provided in your Control Panel.  Use the "Execute SQL" option to execute the SQL thats included in the smtp_sql.sql file against your OS commerce database.
      • To have us do it for you, submit a support request (email to support@3essentials.com) with a request formatted as follows:
        • Please execute the SQL statements necessary for enabling SMTP-AUTH addon/contribution 901 for my OScommerce installation.  I have verified my OSCommerce installation is v2.2 RC1 or otherwise is compatible with this OSCommerce add-on. My OScommerce database is named (insert name here).
    7. This completes the install, the next steps provide info on configuring this add-on.
  5. CONFIGURING SMTP-AUTH OPTIONS:
    1. Log into your OSCommerce installation as admin.
    2. Select My Store from the menu on the left.
    3. Set the values for:
      • Store Name: set to whatever you wish.
      • Store Owner: set to whatever you wish
      • E-Mail Address: set this to the email address you created in step 1, above. 
      • E-Mail From: set this to the email address you created in step 1, above.
    4. Select Email Options from the menu on the left.
    5. Your email options should include the following items... set them as noted here:
    6. OSCommerce Email Options configuration for SMTP-AUTH

      SMTP Server Host Address localhost
      SMTP Server EHLO / HELO Name yourdomain.com (where yourdomain.com is your actual domain name)
      SMTP Server Port Number 25
      SMTP Authentication Required TRUE
      SMTP Authentication Username you@yourdomain.com (specify the email address you created at step 1 above)
      SMTP Authentication Password yourpassword (specify the password to the email address you created at step 1 above)

  6. TESTING:
    • Once you've updated the items in step 5, you're done, and ready to test... here's a simple approach to testing:
      • Visit your OSCommerce store (as a customer would, not logged in as admin)
      • click the Contact Us link, and submit an test "enquiry" via that page... it doesn't matter what you put for Name, email (as long as it's an email address) and enquiry text.
      • After submission, you should get a page with a message similar to "Your enquiry has been successfully sent to the Store Owner."
      • You should receive that email within a few minutes to the email address you specified in the MY STORE options for EMAIL ADDRESS (i.e., the store's email address).

 

 
Downloads Associated With This Article
smtp-auth-update_2.zip : OSCommerce add-on 901 for SMTP-auth