Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2012
    Posts
    8
    Plugin Contributions
    0

    Default SMTPAUTH Problem - need to enable ssl to send email

    On 21 Aug 2012, 03:44 PM I started posting on someone else's thread. I realized I should have started a new topic because I'm dealing with a ssl email problem in version 1.5.
    Quote Originally Posted by SheilaDee View Post
    I am having an email problem very close to Rod44 except my host has said I must "enable SSL within your zencart software." All other settings in the Config > Email Options have been reviewed with my host staff and I have everything set exactly as they have suggested. I followed the link to the topic for ... SMTP-TLP but I haven't found anything for SSL. Could someone advise the exact steps I need to "enable SSL"? Do I need to add a .php file for SSL as was suggested for TLP and if so, could you please tell me exact directions as was done for the person needing TLP.
    Thanks so much.

    21 Aug 2012, 04:38 PM
    I forgot to include the requested details in my post. I'm using Zen Cart 1.5.0, Database Patch Level: 1.5.0 with a new install. I have a template installed by Picaflor Azul.
    The website is installed on PairLite.com and they are using PHP Version: 5.3.15 (Zend: 2.3.0), Database: MySQL 5.1.56.

    I have read everything I could find related to email on the forum, FAQs, Wiki and I've tested several different ways. In emails with the host, the port I used on my own computer for Outlook would not work on the website and they suggested port 465 which I've corrected in the Config > email options.
    21 Aug 2012, 05:37 PM
    Quote Originally Posted by DrByte View Post
    TLS/SSL are often treated the same. So, I would *start* by using the solution already posted for tls since it will most likely work for your needs.

    Has your host SPECIFICALLY told you that "TLS" would be unacceptable?

    Have you tried using the method described already: http://www.zen-cart.com/showthread.p...92#post1136892
    21 Aug 2012, 06:09 PM
    Quote Originally Posted by SheilaDee View Post
    Thank you for your quick reply. I've often seen TLS and SSL written together but I didn't know if the same file would work. I didn't want to break anything so I haven't tried it. My host has not said TLS would be unacceptable, it wasn't mentioned. They simply said "enable SSL within your zencart software." I'll give it a try and report back with my results.

    21 Aug 2012, 07:00 PM
    Well, that didn't fix the problem. I created the file use_tls_for_smtp.php exactly as shown in the link (using notepad++) and added it to the two locations given (using FileZilla). Closed the window on my browser, reopened the browser and went to my website. Sent an email from the Contact Us page and sent an email to a customer (me) from the admin section. No emails arrived. I even checked my emails on their webmail site (different from the website) plus checked the Junk Mail folder. The two emails did not arrive.

    The settings I have in Admin > email options are as follows:

    E-Mail Transport Method::: SMTPAUTH

    E-Mail Linefeeds::: LF

    SMTP Email Account Mailbox::: [email protected] (have actual email address in email options)

    SMTP Email Account Password::: I put the correct password for this email address. (and this address is working fine when sent to/from Outlook Express)

    SMTP Email Mail Host:::: Have the correct information according to my web host.

    SMTP Email Mail Server Port::: Web host said to use 465 which I have.

    Any other ideas?
    Since the last posting, I tried changing the information posted on the linked topic.
    Quote Originally Posted by DrByte View Post
    First set your Zen Cart to SMTPAUTH and provide it with your SMTP credentials.

    Then to tell Zen Cart to use TLS, put the following content into a new PHP file and upload it to 2 locations:
    1. /includes/extra_datafiles/use_tls_for_smtp.php
    2. /your_renamed_admin_foldername/includes/extra_datafiles/use_tls_for_smtp.php

    Code:
    <?php
    define('SMTPAUTH_EMAIL_PROTOCOL', 'tls');
    I removed the new PHP file from the 2 locations, created a new PHP file called use_ssl_for_smtp.php where I used the same define except put 'ssl' instead of 'tls', then uploaded the new file to the two locations. Tested the email and it still didn't work.

    I have the email address added to Outlook Express on my computer and I'm able to send email through the host with no problem, I just can't get ZenCart to send email. I did have a problem originally with Outlook Express until I checked the box "Outgoing Mail Server - My server requires authentication" per the direction of my Host.

    I did a search from Developers Tool Kit for SMTP_EMAIL_PROTOCOL and found the following:
    ----------------------------------------------------------------------------------------------
    /../.../..../..../.../includes/extra_datafiles/use_ssl_for_smtp.php

    Line #1 : define('SMTPAUTH_EMAIL_PROTOCOL', 'ssl');

    ------------------------------------------------------------------------------------------
    /../.../..../..../.../includes/functions/functions_email.php

    Line #34 : if (!defined('SMTPAUTH_EMAIL_PROTOCOL')) define('SMTPAUTH_EMAIL_PROTOCOL', 'none');

    Line #200 : if (defined('SMTPAUTH_EMAIL_PROTOCOL') && SMTPAUTH_EMAIL_PROTOCOL != 'none') {

    Line #201 : $mail->Protocol = SMTPAUTH_EMAIL_PROTOCOL;

    Line #202 : if (SMTPAUTH_EMAIL_PROTOCOL == 'starttls' && defined('SMTPAUTH_EMAIL_CERTIFICATE_CONTEXT')) {

    ----------------------------------------------------------------------------------------------
    /../.../..../..../.../my_renamed_admin_foldername/includes/extra_datafiles/use_ssl_for_smtp.php

    Line #1 : define('SMTPAUTH_EMAIL_PROTOCOL', 'ssl');

    I noticed the 'none' in the functions_email.php and wondered if it should show 'ssl'? The comment just above Line #34 says, "If using authentication protocol, enter appropriate option here: 'ssl' or 'tls' or 'starttls'".

    I have no idea if this information will help troubleshoot the problem, but I hope so. I know very little about .php and the above may not be related, but I know I really need to be able to send emails from ZenCart.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    When you define SMTPAUTH_EMAIL_PROTOCOL to 'ssl', it tells Zen Cart to connect (via fsockopen) to your SMTP server via: ssl://server.address.com:port
    So, that relies on the server knowing what "ssl://" is (ie: OpenSSL compiled into PHP) when the connection is established.

    Can your host tell you the name of the email engine running on the server? And perhaps what settings they've enabled when setting it to use SSL only?
    If they'll give you that information, perhaps we can consult that software's online documentation for clues to what specialized requirements may exist.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    I'll be in touch with my host and will post back here. It will probably be tomorrow before I can get updated information.
    Thanks for your help.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    Addendum: Simply setting the SMTP Port to 465 automatically tells Zen Cart to use SSL. (It will make an connection using fsockopen to ssl://server.address on the port specified. So, it requires OpenSSL to be compiled into PHP and fsockopen to be allowed to talk to external URLs and to resolve names of server addresses properly. These are common basic requirements which any contemporary webserver should be capable of doing.)

    So, again, contrary to what I stated earlier, since at least v1.3.9 there's no need to set SMTPAUTH_EMAIL_PROTOCOL to 'ssl' when the SMTP Port is set to 465 in your admin email settings.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    What might be more useful is to replace your define for SMTPAUTH_EMAIL_PROTOCOL with the following define instead:
    Code:
    define('EMAIL_SYSTEM_DEBUG','2');
    NOTE: That will cause a lot of debug info to be displayed on-screen when an email is generated. And thus you should do it only at a time when the site is NOT busy, because you don't want customers seeing that information.
    That debug info will be useful in troubleshooting.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Aug 2012
    Posts
    8
    Plugin Contributions
    0

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    After trying several things, the cause of the problem was discovered. The email address is case sensitive with my host. I had created the email address with my host in lower case, but I entered the address in Zen Cart with 2 upper case letters. This was causing the failure of the outbound email. This was the first time I've run into a case where the email address was case sensitive. Hopefully this little piece of information will help someone else.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: SMTPAUTH Problem - need to enable ssl to send email

    Thanks for confirming that the problem was with the email username/password.

    Glad you got it sorted out!
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. enable SSL or TLS authentication for email
    By Thannaree in forum General Questions
    Replies: 2
    Last Post: 13 Apr 2012, 06:29 AM
  2. Can I send Email with SSL in zen-cart ?
    By greenlight in forum General Questions
    Replies: 3
    Last Post: 22 Apr 2009, 04:19 AM
  3. Do I need to enable SSL when using Google Check Out?
    By speedcreed in forum Addon Payment Modules
    Replies: 4
    Last Post: 13 Jan 2009, 06:27 PM
  4. send mail YES, smtpauth NO
    By Chrome Orange in forum General Questions
    Replies: 2
    Last Post: 8 Dec 2006, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg