Basic Contact Form in PHP
Posted
by NessDan
on Stack Overflow
See other posts from Stack Overflow
or by NessDan
Published on 2010-04-08T22:57:55Z
Indexed on
2010/04/08
23:03 UTC
Read the original article
Hit count: 311
I'm working on a contact form for my church website.
The church has an email already registered (it's POP3) and the hosting company says their mail server is mymail.brinkster.com .
With all that information, how can you send the form using mail()? The server won't show PHP errors. The current code looks like this:
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: *ChurchsEmail*' . "\r\n";
if(mail("*MyEmailHere*", "Setting Up PHP Email", "This would be the body of the email.", $headers))
{
echo "The email was successfully sent.";
} else {
echo "The email was NOT sent.";
}
All I get back is "The email was NOT sent."
So does anyone have any experience setting up an email form like this? My thanks to anyone who can help me out and any efficient ways of doing this, let me know!
© Stack Overflow or respective owner