How do you send emails encrypted with SSL from php?

Thanks

How do you send emails encrypted with SSL from php?

Thanks

You could probably get the native PHP mail() function to send via TLS. On windows mail() will send through SMTP based on the PHP.ini config. You could probably get this configuration to use TLS. On Linux mail() sends to the sendmail binary. So you'd need to configure sendmail to use TLS.

But is it probably easier off to just talk to either IMAP or SMTP directly. There are many SMTP mailers available in PHP:

http://pear.php.net/package/Mail
http://www.swiftmailer.org/

These should support TLS. I believe you'd need OpenSSL compiled into your PHP executable, or loaded as an extension.

You could also use IMAP over TLS if the IMAP server supports TLS.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.