-1

Please find the code below. This code resides in mydomainname.com

mail("mymail@gmail.com,mymail@mydomainname.com","Testing mail","This is a test mail.","From: mymail@yahoo.com\n");

and

mail("mymail@gmail.com,mymail@mydomainname.com","Testing mail","This is a test mail.","From: mymail@mydomainname.com\n");

I am getting mail to my gmail account (or any yahoo account) for both code, but I am not receiving mail to my webmail or cPanel squirrelmail etc.

I can directly send email to this domain email account

Will the mail server of this domain prevents mails from same domain? The code worked earlier for the same domainname. Is it a problem with hosting side? It's a shared server.

Sal00m
  • 2,938
  • 3
  • 22
  • 33
Vinod
  • 675
  • 3
  • 7
  • 25

1 Answers1

0
Try this
<?php
    $to = "admin@gmail.com,mymail@gmail.com";
         $subject = "Following Customer Signed Up";
      $message = " $username,Customer is signed up with us,<br /><br />
      Thanks <br />";
        // Always set content-type when sending HTML email
        $headers = "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
        // More headers
        $headers .= 'From: <mymail@mydomainname.com>' . "\r\n";
        $mail=mail($to,$subject,$message,$headers);
?>
Hara Prasad
  • 704
  • 6
  • 15
  • Hara, I use the same script in php. For easy reading I put just the email sending line above. – Vinod Oct 17 '14 at 08:29