Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Smtp - Office 365 Rate Topic   - - - - -

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 06 March 2014 - 01:36 AM #1

I'm unable to get the SMTP settings for CS Cart to work with Office 365. Does anyone know how to get that working?

Settings
smtp.office365.com
port: 587
Encryption method: TLS

I've tried this method but Gmail is SSL not TLS: http://kb.cs-cart.com/gmail
Test page shows the following:

if I test for SSL on port 465 (like Google) I get this
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.office365.com:465 (Connection timed out) in /home/luciasim/public_html/smtp.php on line 9

If I test for TLS on port 587 I get this:
Warning: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /home/user/public_html/smtp.php on line 9

Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /home/user/public_html/smtp.php on line 9

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.office365.com:587 (Unknown error) in /home/user/public_html/smtp.php on line 9

CS-Cart 4.7.1


 
  • KPCPC
  • Newbie
  • Members
  • Join Date: 04-Apr 14
  • 7 posts

Posted 04 April 2014 - 05:12 AM #2

Hi,

did you managed to get this working? I tried today as well with no avail.

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 04 April 2014 - 11:06 AM #3

Not working yet...

CS-Cart 4.7.1


 
  • KPCPC
  • Newbie
  • Members
  • Join Date: 04-Apr 14
  • 7 posts

Posted 04 April 2014 - 12:09 PM #4

Did you tried by changing SSL to TLS in the phpmailer?

only TLS is allowed.

Im on support with MS to also find this as it is needed by us ASAP.

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 04 April 2014 - 10:19 PM #5

I tried TLS on port 587 with no luck.
If you get anything to try let me know and I can help beat it up.

CS-Cart 4.7.1


 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 14 May 2014 - 12:02 AM #6

Any luck on this KPCPC?

CS-Cart 4.7.1


 
  • amberooni
  • Newbie
  • Members
  • Join Date: 28-May 14
  • 1 posts

Posted 28 May 2014 - 08:07 PM #7

I am having this same issue. Has anyone figured it out?

Is there a workaround? We upgraded our email system to Exchange and didn't realize it would break /usr/sbin/sendmail that had been used in the past.

Any help would be greatly appreciated.

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 02 June 2014 - 11:36 PM #8

I ended up paying support and they edited two files: class.smtp.php & mailer.php

CS-Cart 4.7.1


 
  • tigerbabba
  • Member
  • Members
  • Join Date: 26-Apr 08
  • 257 posts

Posted 03 June 2014 - 03:05 AM #9

Can you share those two files, please it will help the community. thanks
Currently using CS-Cart 4.x
Fortigate Firewalls

 
  • tigerbabba
  • Member
  • Members
  • Join Date: 26-Apr 08
  • 257 posts

Posted 03 June 2014 - 03:13 AM #10

To fix this simply edit the following file

Change your CS-Cart Email Setting.

/home/YOURDOMAIN/CS-CART/app/lib/other/phpmailer/class.smtp.php
LINE # 131.
// connect to the smtp server
    $this->smtp_conn = @fsockopen('ssl://' . $host,    // the host of the server

Currently using CS-Cart 4.x
Fortigate Firewalls

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 04 June 2014 - 02:28 AM #11

Sounds like you've got it if that code works. They really need to enable these options via the Admin as we'll loose the code on every upgrade. I already lost mine during the recent hacking scare upgrade and forgot to test email which ended up failing for a day until I remembered.

Per posting CS-Cart code (that I paid $45 for) not sure how that works around here. I don't wish to be banned! I would hope to see updates from CS-Cart of their existing Google SMTP page (no v4.x methods listed) and adding O365 or other methods. http://kb.cs-cart.com/gmail

CS-Cart 4.7.1


 
  • Rafass
  • Senior Member
  • Members
  • Join Date: 16-Jan 14
  • 304 posts

Posted 13 July 2014 - 04:28 AM #12

same problem here. some help with it would be very appreciated.
thanks.

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 13 September 2014 - 01:05 PM #13

Whoot!!! 4.2.2 adds TLS encryption option for SMTP and works with O365.
http://www.cs-cart.c...angelog422.html "PHPMailer: "Use Encrypted Connection" settings were added for SMTP server settings"

Here's my settings:
Method: via SMTP
SMTP Host: smtp.office365.com:587
Use Encrypted: TLS
Use SMTP Auth: checked

CS-Cart 4.7.1


 
  • Rafass
  • Senior Member
  • Members
  • Join Date: 16-Jan 14
  • 304 posts

Posted 13 September 2014 - 04:43 PM #14

Whoot!!! 4.2.2 adds TLS encryption option for SMTP and works with O365.
http://www.cs-cart.c...angelog422.html "PHPMailer: "Use Encrypted Connection" settings were added for SMTP server settings"

Here's my settings:
Method: via SMTP
SMTP Host: smtp.office365.com:587
Use Encrypted: TLS
Use SMTP Auth: checked


Yup, works great in my side too :mrgreen:

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 01 October 2015 - 10:27 PM #15

Hello fellow SMTP'ers - a note that the upgrade from 4.3.3 to 4.3.4 may fail for you. I received the following error that stopped the upgrade (upgrade process tries to send an email that the database has been backed up):

"ErrorMessage could not be sent. Mailer Error: SMTP Error: data not accepted."

 

The fix is to switch to PHP Mail Function for the upgrade and then back to SMTP when done. 


CS-Cart 4.7.1


 

Posted 14 April 2016 - 07:59 AM #16

Hi,

[SOLVED] ! Details here:

 

To resolve the issue " Mailer Error: SMTP Error: Data not accepted. ", 

Check all connection settings to be set properly:

Host: outlook.office365.com:587

User: user1@example.com

Pass: secretpassword

Use Encrypted Connection: TLS

 

SMTP Authentification: Checked

 

Make sure that the user "user1@example.com" set above has the "Send As" permissions set (in Office365 administration panel), for the store administrations email account set in "CS-Cart > Settings > Company" .

 

For example: user1@example.com should be allowed to send emails from mystoreadmin@example.com in Office365 exchange settings.



 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 15 April 2016 - 02:21 AM #17

 

Make sure that the user "user1@example.com" set above has the "Send As" permissions set (in Office365 administration panel), for the store administrations email account set in "CS-Cart > Settings > Company" .

 

Thanks for this - Will try as we have the Site Administrator email set to something different than the SMTP settings since we don't want the administrator to get the registration, abandoned cart etc emails.... We'll see if it works for the next upgrade. Was not a problem prior to switching to O365 for email.... 


CS-Cart 4.7.1


 

Posted 27 May 2016 - 08:38 PM #18

Also having this Office365 SMTP "Error Message could not be sent. Mailer Error: SMTP connect() failed."-issue despite trying all suggested fixes mentioned above. Please note I am running Multi-vendor CS-Cart installation (v4.3.6) on Digital Ocean Ubuntu 14.04 LAMP stack droplet. Here are my settings from /admin.php?dispatch=settings.manage&section_id=Emails page:

 

Method: via SMTP server

SMTP host: smtp.office365.com:587

SMTP username: user@myoffice365domain.com

SMTP password: <mypass>

Use Encrypted Connection: TLS

Use SMTP authentication: Checked

 

 

I have also tried testing using the mailtest.php file but am still getting errors like:

 

Warning: fsockopen(): unable to connect to tls://outlook.office365.com:587 (Connection timed out) in /var/www/dev.artisanfishing.com/public_html/mailtest.php on line 9 php

 

...or (if I switch the protocol from tsl:// back to ssl:)...

 

Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in/var/www/dev.artisanfishing.com/public_html/mailtest.php on line 9

Warning: fsockopen(): Failed to enable crypto in /var/www/dev.artisanfishing.com/public_html/mailtest.php on line 9

Warning: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) in /var/www/dev.artisanfishing.com/public_html/mailtest.php on line 9

 

 

I have also looked into adjusting my class.smtp.php file as mentioned here: http://forum.cs-cart...ndpost&p=184898to no avail. Also note that my class.smtp.php lives in a different place than mentioned in comment #10, mine lives here: /app/lib/vendor/phpmailer/phpmailer/class.smtp.php

 

Is there something else I'm missing or additional documentation on this issue?

 

 

Thank you,

_rs



 
  • MrGrant
  • Junior Member
  • Members
  • Join Date: 07-Dec 06
  • 38 posts

Posted 30 May 2016 - 11:15 PM #19

We used the setting below and at first it didn't work, but then tried again and it did.

 

Method: via SMTP server

SMTP host: smtp.office365.com:587

SMTP username: user@myoffice365domain.com

SMTP password: <mypass>

Use Encrypted Connection: TLS

Use SMTP authentication: Checked

 

However using SMTP I found it takes 18 seconds to come back to the Customer and say "Congratulations! Your order has been successfully placed."

 

With "via php mail function" it was more like 2 seconds.

 

Do others have similar results? Is that just the nature of SMTP?

 

If so it would seem "via php mail function" is the preferred option anyway.


CS-Cart V4.3.6, PHP 7.0.7, Linux VPS managed by www.serverpilot.io


 
  • alaa
  • Senior Member
  • Members
  • Join Date: 18-Mar 18
  • 167 posts

Posted 24 June 2018 - 07:57 AM #20

Using SMTP email with Office 365 is working on my store but it is very slow. CS-Cart needs to wait more than 20 seconds for the email to be sent. However, PHP Mail or Sendmail is very fast.

 

Do you experience such delay in Office 365 SMTP relay? 

 

Thanks!