所以,在我的服务器上,我正在运行几个网站。除了我的主要网站之外,我的所有网站都将根目录配置为网站的“公共”文件夹(出于安全目的)。但是,我的一个非主要站点使用Amazon SES发送电子邮件,因此需要运行OpenSSL。但我不相信,通过更改的root权限,脚本可以找到OpenSSL,在我收到错误的帐户上:
Warning: stream_socket_enable_crypto(): SSL: Success in /public/lib/mailer/class.smtp.php on line 274
2014-05-04 04:52:41 CLIENT -> SERVER: QUIT
2014-05-04 04:52:42 SERVER -> CLIENT:
2014-05-04 04:52:42 SMTP ERROR: QUIT command failed:
SMTP connect() failed.
Failed to send the message!
每次运行脚本。但是,当我在没有更改root权限的情况下运行站点上的代码时,它运行正常。有没有办法让我的非主要网站检测OpenSSL或可能将重要的OpenSSL文件复制到所述网站的根目录?希望这对你们都有意义。任何帮助,将不胜感激。谢谢。这是我感兴趣的任何人的电子邮件代码的副本:
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = '54.213.255.181'; //IP of AWS SES (email-smtp.us-west-2.amazonaws.com)
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = 'SMTPUsername'; //Correct
$mail->Password = 'SMTPPassword'; //Correct
$mail->Sender = 'email@domain.com';
$mail->From = 'email@domain.com';
$mail->FromName = "My Name";
$mail->addAddress($to, $fname . " " . $lname);
$mail->SMTPDebug = 2;
$mail->Subject = $subject;
$mail->Body = $html;
$mail->AltBody = $msg;
$mail->SmtpClose();
$mail->XMailer = "";
$mail->Encoding = "base64";
if(!$mail->send()) {
$info = 'Failed to send the message!';
}
else{
$info = 'Message has been forwarded to sendmail.';}
echo $info;
}