PHP Email Form not working!

  • fredbloggs_XIII
  • Born
  • Born
  • No Avatar
  • Joined: Jul 26, 2008
  • Posts: 1
  • Status: Offline

Post July 26th, 2008, 6:05 am

Hello. I have got an enquiry form on my website which should send the users input to my email address. The email arrives but it does not include any of the forms content, i.e. the mail is blank. Can anyone help? Here is my send mail script:

<?php
$email = $_POST["emailaddress"] ;
$telephone = $_POST["telephonenumber"] ;
$type = $_POST["enquirytype"] ;
$message = $_POST["enquiry"] ;

mail( "me@me.com", "Website Enquiry", $message, "From: $email" ) ;

header( "Location: http://(Web Address)/Enquiry_Submitted.html" )
; ?>
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 26th, 2008, 6:05 am

  • George L.
  • Bronze Member
  • Bronze Member
  • No Avatar
  • Joined: Nov 05, 2007
  • Posts: 2206
  • Loc: Malaysia
  • Status: Offline

Post July 26th, 2008, 7:26 am

You're not sending a copy to yourself. You should include 'your email e.g. linda@example (dot) com' after the $email = $. . .

Don't ask for the exact code, I've done it months back it takes me time to search it.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23407
  • Loc: Woodbridge VA
  • Status: Offline

Post July 26th, 2008, 8:59 am

Try the format I posted here
flash-forum/send-mail-via-php-using-flash-t83259.html

Although that's for a Flash form, the concept is identical.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • oi_antz
  • Born
  • Born
  • No Avatar
  • Joined: Jul 27, 2008
  • Posts: 4
  • Status: Offline

Post July 27th, 2008, 3:21 am

Check out PHP Mailer, it works with SMTP too:
Code: [ Select ]
include_once(INCLUDES_DIR.'/ThirdParty/phpmailer/class.phpmailer.php');

$mail = new PHPMailer;
$mail->IsMail(true);
$mail->From = $toFrom['fromEmail'];
$mail->FromName = $toFrom['fromName'];
$mail->AddAddress($toFrom['toEmail'], $toFrom['toName']);
$mail->WordWrap = 50;
$mail->IsHTML($html);
$mail->Subject = $subject;
$mail->Body = $content;
$mail->AltBody = strip_tags($content);

return $mail->Send();
  1. include_once(INCLUDES_DIR.'/ThirdParty/phpmailer/class.phpmailer.php');
  2. $mail = new PHPMailer;
  3. $mail->IsMail(true);
  4. $mail->From = $toFrom['fromEmail'];
  5. $mail->FromName = $toFrom['fromName'];
  6. $mail->AddAddress($toFrom['toEmail'], $toFrom['toName']);
  7. $mail->WordWrap = 50;
  8. $mail->IsHTML($html);
  9. $mail->Subject = $subject;
  10. $mail->Body = $content;
  11. $mail->AltBody = strip_tags($content);
  12. return $mail->Send();

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 112 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.