On 6/8/07, itoctopus [EMAIL PROTECTED] wrote:
Remove the @ next to the mail function, probably there's a warning
somewhere. Additionally, are you sure that your mail server is actually
working?
--
itoctopus - http://www.itoctopus.com
Austin C [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello, I just finished making a PHP contact form for my webite, and I can
run through the whole thing, and get no errors, but it doesnt email me the
form contents.
*Here is th actual form page:*
?php include(../header.php); ?
td bgcolor=#BFC4CBbfont color=#33Contact
Me/font/b/td
/tr
/table
/td
/tr
tr
td bgcolor=#BFC4CB
p
font color=#33
Please use this form to contact me:
p
brcenterform action=processcontactform.php method=post
Name: input type=text name=name size=20
brEmail Address/Method of Contact: input type=text name=contact
size=30
brReason for Contact: select name=reasonforcontact
option value=questionQuestion/option
option value=suggestionSuggestion/option
option value=gcommentGeneral Comment/option
option value=fanmailFan Mail/option
option value=otherOther/option
/select
brMessage: brtextarea name=message1 rows=10 cols=30/textarea
brinput type=submit value=send
/form/center
?php include(../footer.php); ?
*Here is the form page processor:*
?php include(../header.php); ?
td bgcolor=#BFC4CB
b
font color=#33Processing your information . . ./font/b/td
/tr
/table
/td
/tr
tr
td bgcolor=#BFC4CB
p
font color=#33
?php
$name = $_POST['name'];
$email = $_POST['contact'];
$reason = $_POST['reasonforcontact'];
$message = $_POST['message1'];
$to = [EMAIL PROTECTED];
$subject = Contact Form Submitted at GWD-Dev;
$body = Hello Austin,
.$name. has sent in a contact form at GWD-Dev. The reason he/she
contacted you was for .$reason.. Here is the message they submitted with
their form:
.$message.
The contact field of the form contained the following information:
.$email.
Please remember to get back to them ASAP!!;
$headers = From: .$name. .$email.\n;
echo Collecting information . . . . . . . . . . DONE!p;
$mail_sent = @mail($to, $subject, $body, $headers);
echo $mail_sent ? brSending contact form to webmaster . . . . . . . .
DONE!p : scriptalert('The mail did not go through')/script;
echo br. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . .p;
echo brThank you for contacting us, please expect a reply in anywhere
from 1 to 24 hours. Make sure that our email address,
[EMAIL PROTECTED]
[EMAIL PROTECTED], are not sent to your spam folder.;
include(../footer.php); ?
--
Thanks, the webmaster of Galacticneo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You're missing a hard return in your From: header field. Email
servers won't accept just an \n at the end. Instead, you have to use
\r\n. That should fix the issue, but as itoctopus said, you should
also remove the error buffering (@) from the mail function in case
there are other errors.
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php