Jump to content

Resolved - I can not get SMTP to GMAIL to work on Cubecart 5! Help


chum63

Recommended Posts

My store has been using the mail on the server and send email, but they always end up in peoples SPAM folder and I have tried everything - google are investigating for me, but I thought in the meantime I would set up my cart to use the remote smtp gmail server to get around this for now. I have the following setting:

 

smtp.gmail.com

465 Port

SSL set on

User name - my email address and password.

 

All fine and these setting work fine on other products.

 

But in cubecart no emails ar sent.

 

As far as I am aware all the ports are open to be used.

 

Any suggestions or at least someone saying they have this working on their server would be very encouraging.

 

Thanks in advance

 

Server and software info:

 

 

CubeCart Version 5.1.5 PHP Version 5.3.18 MySQL Version 50096 Image folder size 112.6 MB Download folder size 0 Bytes Max. Upload filesize 105M Browser user-agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17 Server Software Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635    
Link to comment
Share on other sites

CubeCart uses the (rebooted) PHPMailer utility. PHPMailer is fully capable of communicating with smtp.gmail.com using the protocols required by Google.

 

Those requirements are:

  • Gmail SMTP server address: smtp.gmail.com
  • Gmail SMTP user name: Your full Gmail address (e.g. [email protected])
  • Gmail SMTP password: Your Gmail password
  • Gmail SMTP port: 465 with SSL
  • Gmail SMTP port: 587 with TLS

Here is what may be the problem: CubeCart does not tell PHPMailer to enable the SMTP Secure setting, using SSL or TLS. Thus, Google is probably actively refusing the connection.

 

In the file /classes/mailer.class.php, find near line 39:

$this->Port = $GLOBALS['config']->get('config', 'email_smtp_port');

 

After that line, add the following on a new line:

switch($this->Port){case 465:$this->SMTPSecure = 'ssl';break;case 587:$this->SMTPSecure = 'tls';}

 

I don't know if this is sufficient. I haven't tried it.

 

Try both ports. Let us know.

 

(An old posting suggested this: Use tls://smtp.gmail.com for the server name.)

Link to comment
Share on other sites

Hi - just wanted to confirm that I added the switch statement to line 40 in my mailer.class.php and set up cubecart to use port 465 for SSL it works a treat!  Thank you so much for the clear instructions.  I assume I will have to keep changing on every upgrade?

 

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...