0

I have a code to send mails, the code work fine and mail sent but I get the mail from an address wird the mail that I get the email from: star1231@a2plcpnl0005.prod.iad2.secureserver.net

my code:

$from = 'From: System@dmworld24.com';
if (!sendMail($_POST['mail'], $text['EMAIL_RECOVER_MSG_SUBJECT'], $text['EMAIL_RECOVER_MSG'], $from))

the send mail function:

 function sendMail ($to, $subject, $msg, $from, $add = null) {
$from = array($from,
"Reply-To: system@dmworld24.com",
"X-Mailer: PHP/" . PHP_VERSION
 );
 $from = implode("\r\n", $headers);
return mail($to, $subject, $msg, $from);
}
sdfds dffdsf
  • 61
  • 1
  • 2
  • 7

1 Answers1

1

Remove From: from value of variable $from

Change from

$from = 'From: System@dmworld24.com';

Into

$from = 'System@dmworld24.com';

It is recommended to use PHPMailer class.

Muhammad Hassaan
  • 7,296
  • 6
  • 30
  • 50