0

I am using Windows. When I try to send mail using php mailer. It returns "couldn't instantiate mail function". Is it some permission issue or is there anything wrong with code? Thanks!

<?php   
    require_once("class.phpmailer.php");//location is correct
    require_once("class.smtp.php");//location is correct

    $to_name = "Good Better";
    $to = "sending@example.com";
    $subject = "Mail Test at ".strftime("%T", time());
    $message = "This is a test.";
    $message = wordwrap($message,70);
    $from_name = "My Name";
    $from = "myacc@example.com";


    $mail = new PHPMailer();


    $mail->FromName = $from_name;
    $mail->From     = $from;
    $mail->AddAddress($to, $to_name);
    $mail->Subject  = $subject;
    $mail->Body     = $message;

    $result = $mail->Send();
    echo $result ? 'Sent' : $mail->ErrorInfo;

?>
dre
  • 23
  • 8
  • I don't know what is wrong with it.I am using Windows.Is there anything I have to change for it?I haven't changed anything in php.ini file. – dre May 27 '16 at 03:55
  • Please check this [URL](http://stackoverflow.com/help) it will be useful to lift your content quality up – Willie Cheng May 27 '16 at 03:55
  • 3
    Possible duplicate of [Could not instantiate mail function. Why this error occuring](http://stackoverflow.com/questions/1944631/could-not-instantiate-mail-function-why-this-error-occuring) – Dinidu Hewage May 27 '16 at 03:55
  • @Iti Tyagi have can I solve this problem if it is an permisson issue? – dre Jul 21 '16 at 06:17

0 Answers0