hey,
I’m working with a mail php script, I’ve used it plenty of times before but I can’t seem to get it to do anything. I’ve tried my own host and some one elses. So there must be something I’m doing wrong.
Here is the code:
<?php
if(isset($_POST['submit']))
{
$to = "test@test.com";
$subject = "Test PHP Email";
$message = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
$headers = "From : Test PHP Email <noreply@testphpemail.com>";
mail($to, $subject, $message, $headers);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Email</title>
</head>
<body>
<p>Send a Test PHP Email to Test</p>
<form name="test" method="post">
<input type="submit" name"submit" value="Submit" />
</form>
</body>
</html>
It looks ok to me, perhaps mail is turned off in the php.ini ? (Not sure)
It’s only test code I’m showing at the moment. It’s not exactly how i have it setup for the script I’m using, but the mail section is identical.
Any help advice would be most appreciated.
Cheers.