邮件程序错误:扩展程序丢失:php中的openssl

时间:2015-05-29 12:20:28

标签: php email

经过一些编辑我的email.php源代码后,

下面,

var app = angular.module('app', ['ui.bootstrap']);

app.controller('MyCtrl', ['$scope', '$modal', function($scope, $modal) {
  $scope.openModal = function () {
    var popup = $modal.open({
            template: '<my-modal></my-modal>',
            resolve : {
                mydata : function() {
                    return 42;
                }
            }
        });
  };
}]);

app.controller('ModalController', ['$scope', 'mydata', function($scope, mydata) {
  //The error is in this directive controller
  $scope.mydata = mydata;
}]);

app.directive('myModal', function() {
  return {
    restrict: 'E',
    templateUrl : 'mymodal.html',
    controller : 'ModalController',
    replace: true
  };
});

这里是html:

<?php

// $email and $message are the data that is being
// posted to this page from our html contact form
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

require_once('class.phpmailer.php');
require 'PHPMailerAutoload.php';
require 'class.smtp.php';

$mail = new PHPMailer();
$body='hellooooo';
$mail->IsSMTP();

$mail->Host = "ssl://smtp.gmail.com"; // specify main and backup server

$mail->SMTPAuth = true; // turn on SMTP authentication

$mail->Username = "mygmailid@gmail.com"; // SMTP username
$mail->Password = "mygmailpassword"; // SMTP password
$mailer->SMTPSecure = 'ssl';
$mailer->Port = 465;//587;
$mail->AddAddress("bradm@inmotiontesting.com", "Brad Markle");
$mail->SetFrom('rajaselva.csc@gmail.com','Selva Rani');
$mail->WordWrap = 50;

$mail->IsHTML(true);

$mail->Subject = "You have received feedback from your website!";

$mail->MsgHTML($body);

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

echo "Message has been sent";
?>
运行后

显示错误,

  

无法发送消息。

     

邮件程序错误:扩展程序丢失:openssl

注意:我在堆栈中提到了类似的问题,但它并没有帮助我,所以只有我发布了新的。而且我也是php的新手,但我想特别了解这一部分。

毕竟,我在php.ini文件中的这一行<form method="post" action="email.php"> Email: <input name="email" id="email" type="text" /><br /> Message:<br /> <textarea name="message" id="message" rows="15" cols="40"></textarea><br /> <input type="submit" value="Submit" /> </form> 中删除了分号

但仍然保持相同的错误..

有人可以帮忙吗?

谢谢,

0 个答案:

没有答案