Smtp - Office 365

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: [url=“CS-Cart Documentation — CS-Cart 4.15.x documentation”]CS-Cart Documentation — CS-Cart 4.15.x documentation

Test page shows the following:



if I test for SSL on port 465 (like Google) I get this

[font=courier new,courier,monospace]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[/font]



If I test for TLS on port 587 I get this:

[font=courier new,courier,monospace]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[/font]



[font=courier new,courier,monospace]Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /home/[/font]user[font=courier new,courier,monospace]/public_html/smtp.php on line 9[/font]



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

Hi,



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

Not working yet…

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.

I tried TLS on port [color=#282828][font=arial, verdana, tahoma, sans-serif]587 with no luck. [/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]If you get anything to try let me know and I can help beat it up.[/font][/color]

Any luck on this KPCPC?

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.

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

Can you share those two files, please it will help the community. thanks

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

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. [url=“CS-Cart Documentation — CS-Cart 4.15.x documentation”]CS-Cart Documentation — CS-Cart 4.15.x documentation

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

thanks.

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

[quote name=‘grafis’ timestamp=‘1410613529’ post=‘192175’]

Whoot!!! 4.2.2 adds [color=#ff0000]TLS encryption[/color] 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

[/quote]



Yup, works great in my side too :mrgreen:

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.

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.

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....

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§ion_id=Emails page:

Method: via SMTP server

SMTP host: smtp.office365.com:587

SMTP username: user@myoffice365domain.com

SMTP password:

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.com/topic/35060-smtp-office-365/?view=findpost&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

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:

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.

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!