【问题标题】:Can you send emails from localhost with PHPmailer?您可以使用 PHPmailer 从本地主机发送电子邮件吗?
【发布时间】:2012-03-18 06:38:48
【问题描述】:

我试过了,但我得到“错误:无法连接到服务器:无法找到套接字传输“ssl” - 您在配置 PHP 时是否忘记启用它?”

$mail = new \PHPMailer(true); 

$mail->IsSMTP();
$mail->Host       = "smtp.gmail.com";
$mail->Port       = 465;
$mail->SMTPDebug  = 2;
$mail->SMTPAuth   = true;
$mail->SMTPSecure = 'ssl';
$mail->Username   = "xctgrlx420@gmail.com";
$mail->Password   = "wr^#@f9h@)(f";

$mail->AddAddress('contact@mywebsite.com', 'John Doe');
$mail->SetFrom('me@me.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->MsgHTML('Add some HTML here');
$mail->Send();

【问题讨论】:

标签: php email phpmailer


【解决方案1】:

一个简单的谷歌搜索发现了这个论坛 - http://forums.devshed.com/php-development-5/unable-to-find-the-socket-transport-ssl-667689.html

我猜问题是你需要“OpenSSL extension”。

【讨论】:

    猜你喜欢
    • 2015-04-15
    • 1970-01-01
    • 2013-09-03
    • 2016-07-22
    • 2021-04-19
    相关资源
    最近更新 更多