0

I have my domain on 1and1 and hosting on godaddy. Now, i created email account on 1and1 my domain account.

I received email on my 1and1 email account from directly send on any email but its not work for me using PHP code to send email.

Below is my PHP code:

  $to = 'support@mydomain.com';
    $_POST['from'] = "Get a free quote - ";
  $subject = $_POST['from'].'Inquiry from Website';
  $message = " Hello, <br><br>
  This is test email. <br><br>
  Thanks";

  $headers = 'From: Quotes <harsh08@gmail.com>' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
  $headers .= "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
  mail($to, $subject, $message, $headers);

If i change my domain email to my gmail then i received email on gmail account using above code.

I tried lot but did not get any solutions still. Anybody have a knowledge or experience in it then please share with me.

Thanks

user1780370
  • 851
  • 1
  • 17
  • 27

1 Answers1

0

Check your spam and spelling of email address. Sometimes mail servers detect mail as spam.

Md. Mahmud Hasan
  • 1,033
  • 1
  • 7
  • 24