Please Help With Mail Send Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MattGun
Forum Newbie
Posts: 2
Joined: Thu May 22, 2014 3:45 am

Please Help With Mail Send Script

Post by MattGun »

Please help me with this. I'm using this little PHP program to collect some information and get them emailed to me...everything is working but no messages in the body. The email comes to me but nothing in the body. I'm supposed to get the name, email, phone # and how soon but I receive a blank email. I have the script posted on celebritynosejobs.net if you would like to see it!

Code: Select all

<?php
$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
    {
    ?>
<br /><br />
    <font size='1'>Fill out the form below and we'll contact you with more information as soon as possible.</font><br /><br />
    <form  action="" method="POST" enctype="multipart/form-data">
    <input type="hidden" name="action" value="submit">
    <b>Your full name:</b><br>
    <input name="name" type="text" value="" size="30"/><br>
    <b>Your email address:</b><br>
    <input name="email" type="text" value="" size="30"/><br>
    <b>Your Phone #:</b><br>
    <input name="phone" type="text" value="" size="30"/><br>
    <b>How soon?</b><br>
    <input name="howsoon" type="text" value="" size="30"/><br>
    <font size="1">We hate spam too! Your information will only be shared with the doctor.</font>
    <p align="right"><input type="submit" value="SEND MAIL"/></p>
    </form>
    <?php
    }
else                /* send the submitted data */
    {
    $name=$_REQUEST['name'];
    $email=$_REQUEST['email'];
    $phone=$_REQUEST['phone'];
    $howsoon=$_REQUEST['howsoon'];
    if (($name=="")||($email=="")||($phone=="")||($howsoon==""))
        {
        echo "<br><br><font color='red' size='3'>All fields are required, please fill <a href=\"\">the form</a> again.</font><br><br>";
        }
    else{
        $from="From: $name<$email>\r\nReturn-path: $email";
        $subject="Free Plastic Surgery Consultation Request";
        mail("myemailaddress@email.com", $subject, $message, $from);
        echo "<br /><br /><font color='blue'><b>Form is sent! Thank you for using CelebrityNoseJobs.net to find a Cosmetic/Plastic Surgeon practice in $details->city. We will provide your information to participating specialists in the area and they will get back to you with more information as soon as possiblle.</b></font><br /><br />";
        }
    }
?>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Please Help With Mail Send Script

Post by requinix »

You never actually defined $message.
kydude1957
Forum Commoner
Posts: 31
Joined: Sun Sep 14, 2014 1:37 am

Re: Please Help With Mail Send Script

Post by kydude1957 »

I liked this script and just to try to see if it worked for me to resolve my not receiving mail I changed the email to my email in the mail statement. I get the message that the form is sent but receive no email. According to Chromes inspector when you click "Submit" it says POst status 200. Tried a couple of email addresses and none receive any mail.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Please Help With Mail Send Script

Post by requinix »

kydude1957 wrote:I liked this script and just to try to see if it worked for me to resolve my not receiving mail I changed the email to my email in the mail statement. I get the message that the form is sent but receive no email. According to Chromes inspector when you click "Submit" it says POst status 200. Tried a couple of email addresses and none receive any mail.
Unfortunate, but that doesn't help MattGun with his problem.
Post Reply