Home » Networking » Net_SMTP » Bug #2849
Net_SMTP works with SSL, but the docs hide this useful fact.
Details
| Request #2849 | Net_SMTP works with SSL, but the docs hide this useful fact. |
|---|---|
| Submitted | 2004-11-29 08:01 UTC |
| From | drachma60 at ml1 dot net |
| Status | Closed |
| Package | Net_SMTP |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2004-11-29 08:01 UTC] drachma60 at ml1 dot net
Description:
------------
The following code will open up an SSL connection to a mail server (assuming, of course, PHP has SSL support compiled in).
$host = "mail.host.com";
$host = "ssl://$host";
$port = 465; // 465 is a common smtps port
$smtp = new Net_SMTP ("$host", $port);
$smtp->connect ();
Some SMTP authentication methods send the password as cleartext. It is therefore a good idea to encrypt the connection to prevent password sniffing.
However, the Pear documentation for Net_SMTP (link below) makes no mention of this non-obvious method of encrypting SMTP connections.
http://pear.php.net/manual/en/package.networking.net-smtp.net-smtp.net-smtp.php
Additionally, adding a link to the below page would be useful, as it contains further information about fsockopen and possible formats of the $host string in various version of PHP.
http://www.php.net/manual/en/transports.php
Thanks for supporting PHP!