0

I have used the same code from tutorial but i don't know what is error & not getting email in my gmail account. i have already check after upload the code on server

<html>
<head>

</head>
<body>

<?php

$to="rinku.d52@gmail.com_";
$subject="Test mail";
$massage="This email is from Sandeep Kumar";
$headers="From:Sandeep Kumar<sandeep@gmail.com>";
if(mail($to, $subject, $massage, $headers))
{

echo"email Sent";

    }
else{

    echo"failed";

}

</body>
</html>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
sandeep
  • 11
  • I would definitely recommend using one of the tried and tested mail libraries (like PHPMailer, SwiftMailer and similar) instead of the low level PHP `mail()`-function. They will give you a more verbose API and let's you easily use a proper IMAP-server to send the emails which, among other things, will make your script more portable since it won't depend on any server configuration. – M. Eriksson Dec 30 '18 at 19:05

1 Answers1

1

Try removing the _ from your $to?

$to="rinku.d52@gmail.com";
mayday
  • 37
  • 6