-1

sadly, I find myself in need of your help again...

I recently changed my hosting provider to Namecheap (like a month ago) and today I just noticed that I'm not receiving emails sent through the contact form on my site amelicakes.com.

The PHP code of this form hasn't changed and the contact form worked perfectly on my previous hosting provider.

PHP for the contact form is below:

<?php header('Content-Type: text/html; charset=utf-8');
      header('Content-Transfer-Encoding: 8bit');
if(isset($_POST['email'])){
        $mailTo = "ameli_cakes@abv.bg";
        $subject = "mail from web";
        $body = "New message from web
<br><br>
FROM: ".$_POST['email']."<br>
NAME: ".$_POST['name']."<br>
SUBJECT: ".$_POST['subject']."<br>
COMMENTS: ".$_POST['message']."<br>";   
        $headers = "To: Ameli Cakes <".$mailTo.">\r\n";
        $headers .= "From: Contact Form <contact@amelicakes.com>\r\n";
        $headers .= 'Content-Type: text/HTML; charset=utf-8' . "\r\n";
        $headers .= 'Content-Transfer-Encoding: 8bit'. "\n\r\n";
        //envio destinatario
        $mail_success =  mail($mailTo, $subject, $body, $headers);      
}
?>

After talking with a Namecheap representative, they told me that "PHP debugging is out of their scope" and to check this link.

Guys... I tried but I have no idea what I'm doing, and before making my PHP form unusable I decided to revert back to the original version and ask for help here.

I think I need to send these emails to an email account hosted in their servers so I created contact@amelicakes.com but I don't know how to continue.

Whatever help you can provide would be greatly appreciated, keep in mind that my PHP knowledge is very limited.

Thanks in advance to whoever is reading this!

PS: Please do not close this as duplicate, I have checked the alternatives and I do not understand how they apply to my case, the code seems different.

Nipponshin
  • 23
  • 1
  • 8
  • You shouldn't need to make any changes to your PHP code. Most likely, your ISP is blocking mail from Namecheap. – Barmar Dec 22 '15 at 21:33
  • If you disagree with the duplicate closure, you need to explain why your question is different, because it obviously looks the same to others. And don't just look for the same function or keyword names - really work to understand the other code, because it may just be demonstrating a different (possibly superior) approach to your task. If you still don't understand why it's a duplicate, explain your reasoning. – skrrgwasme Dec 22 '15 at 22:57
  • Well that's the case, I do not understand why it's a duplicate when the code looks so different. Like I said on the original post, my PHP knowledge is limited so that's why I asked for help. I followed the instructions kindly provided by Matt here but the issue persist. I do not understand how to use that other post to help solve my issue and I would appreciate some help. – Nipponshin Dec 23 '15 at 00:59

1 Answers1

0

In order to avoid issues related to spam it is possible to use in FROM field only email hosted at our servers

https://www.namecheap.com/support/knowledgebase/article.aspx/9239/31/how-to-configure-contact-form-hosted-with-us.

You're allowing the from email to be whatever the client inputs which is an email most likely not held on the namecheap servers. You need to make sure that where $_POST['email'] is, there is an email that is on your namecheap account. So, for example:

  $headers .= "From: Contact Form <contact@amelicakes.com>\r\n";
Matt
  • 2,851
  • 1
  • 13
  • 27
  • Hi Matt, Thanks for the clear answer. I have changed my code like you said but I'm still not receiving the emails. I updated the code in the main post so you can check, thank you for your help! – Nipponshin Dec 22 '15 at 21:52