Categories
Tech Encounters

Why is Drupal “Contact Form” not sending any email?

PROBLEM : My “Contact Form” in Drupal (v6.14) was not delivering any email to my mailbox. No error was indicated in Drupal logs.

SOLUTION : Turned out my web hosting company had to move my domain name record from /etc/localdomains to /etc/remotedomains.

Here’s a php script to test the sending of email:

<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a test message.";
$from = "<name>@<your domain>";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>