PHP Email Form not working!

  • fredbloggs_XIII
  • Born
  • Born
  • fredbloggs_XIII
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • George L.
  • Bronze Member
  • Bronze Member
  • George L.
  • Posts: 2209
  • Loc: Malaysia

Post 3+ Months Ago

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
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • oi_antz
  • Born
  • Born
  • oi_antz
  • Posts: 4

Post 3+ Months Ago

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 71 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.