Thursday 11 April 2019

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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...