0

I have written below code getting error while executing.

<?php
        $to = "somebody@example.com";
        $subject = "My subject";
        $txt = "Hello world!";
        $headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
        $retval = mail($to,$subject,$txt,$headers);
         if( $retval == true ) {
            echo "Message sent successfully...";
         }else {
            echo "Message could not be sent...";
         }
      ?>

URL : http://www.casaplaya.co.za/test-email.php

Message could not be sent... PHP Warning: mail(E:\IIS\LogFiles\PHP\php53mail.log): failed to open stream: Permission denied in F:\domains\casaplaya.co.za\wwwroot\test-email.php on line 18 PHP Warning: mail(): SMTP server response: 550 No such user here in F:\domains\casaplaya.co.za\wwwroot\test-email.php on line 18

I am unable to figure out the the issue. It will be great if anybody help me to find out the solution.

Thanks in advance.

  • 1
    Did you add the correct user to header? – Phiter Mar 08 '16 at 12:30
  • 1
    Possible duplicate of [mail(): SMTP server response: 550 The address is not valid error on hmailserver](http://stackoverflow.com/questions/12495509/mail-smtp-server-response-550-the-address-is-not-valid-error-on-hmailserver) – Vigikaran Mar 08 '16 at 12:39

0 Answers0