I know that CiviCRM can send e-mail using SMTP and SSL by prefixing ssl:// to the SMTP server name, but my organization uses Office365, which only supports SMTP with TLS. Is there a way to get CiviCRM to work with the Office365 SMTP server (ideally without resorting to Postfix and sendmail)?
For performance, avoid remote SMTP entirely.
Using SMTP directly to hosted mail products will be tangibly slower while the SMTP transaction blocks the PHP request; having a "real" local MTA which then smarthosts to Office 365 allows CiviCRM to offload messages quicker (local process/filesystem versus remote network).
Stack Exchange prefers documenting the actual process to external links but in this case I'll do the latter since you have several options, and hey, I'm already not answering your actual request :)
- Configure CiviCRM to use local mail delivery, AND
- Configure Postfix to smarthost to office365 using SMTP auth for a single origin address, OR
- Configure Postfix to smarthost to office365 using Office365 connectors for multiple origin addresses, OR
- Do the same for your preferred local MTA.
CiviCRM supports TLS connections - and IIRC you just preface with ssl:// (even though it's TLS, not SSL) and select the appropriate port.
However, TLS is currently broken if authentication is required - see https://issues.civicrm.org/jira/browse/CRM-14814 and http://forum.civicrm.org/index.php?topic=21960.0. There seems to be an open PR (https://github.com/civicrm/civicrm-packages/pull/66) - I'm not sure why this wasn't merged, but it's against Civi 4.4, and would probably need to be ported forward.
I have used tls://pod51010.outlook.com:465 to connect to an Office365 SMTP server with other software (Forum). Since CiviCRM allows us to specify the port, I would just use tls://pod51010.outlook.com as the SMTP Server Name.
I cannot test with CiviCRM right now as I no longer have an Office 365 account, but I would give that a try first.
As Jon G notes, TLS is currently broken. The Forum reference gives patching information, which I've just now successfully applied to CiviCRM 4.6.8, running under WordPress 4.3.1. The broken module is: (your http root)/wordpress/wp-content/plugins/civicrm/civicrm/packages/Net/SMTP.php
Searching the module for the text "// CiviCRM: CRM-8744" get you to the right spot to follow the instructions given by TravelingPharaoh in the forum post, reply 10 (BTW: Thanks to TravelingPharaoh). A reboot, and you are in business.
So this is another confirmation of the need for the fix that is in progress, per CRM-14814.