Wednesday, 20 April 2016

email - PHP mail function is not working on Hostgator

I have to use mail function in my project. When I host my project on hostgator, it doesn't work. But when I host on other server, it works fine. I can't understand problem. If anyone know answer then please explain or suggest me link from where I can understand from beginning. Thank You. Here is my code.



$to_address = "test@somedomain.com";
$subject = "This goes in the subject line of the email!";
$message = "This is the body of the email.\n\n";
$message .= "More body: probably a variable.\n";

$headers = "From: test@somedomain.com\r\n";
mail("$to_address", "$subject", "$message", "$headers");

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...