1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Php Mail Help!!!

Discussion in 'PHP' started by badmasketa, Dec 14, 2008.

  1. #1
    <table border="0" cellpadding="1" cellspacing="1">
        <tr>
          <td><select name="nameTitle1" id="select">
            <option selected="selected">Mr.</option>
            <option>Ms.</option>
            <option>Mrs.</option>
          </select>      </td>
          <td><input name="fName1" id="fName1" value="" size="17" type="text" /></td>
          <td><input name="lName1" id="lName1" value="" size="10" type="text" />      </td>
        </tr>
        <tr>
          <td><select name="nameTitle2" id="select">
            <option selected="selected">Mr.</option>
            <option>Ms.</option>
            <option>Mrs.</option>
          </select>      </td>
          <td><input name="fName2" id="fName2" value="" size="17" type="text" /></td>
          <td><input name="lName2" id="lName2" value="" size="10" type="text" />      </td>
        </tr>
        <tr>
          <td><select name="nameTitle3" id="select">
            <option selected="selected">Mr.</option>
            <option>Ms.</option>
            <option>Mrs.</option>
          </select>      </td>
          <td><input name="fName3" id="fName3" value="" size="17" type="text" /></td>
          <td><input name="lName3" id="mName3" value="" size="10" type="text" />      </td>
        </tr>
    </table>
    HTML:
    thats the HTML code, and when the users submit that form, whether the form is empty or not, only the filled up informations should be mailed to given email.
    I just know it is easier to do in ARRAY, but i am not so much in PHP :p

    can you help me??
     
    badmasketa, Dec 14, 2008 IP
  2. haradeep

    haradeep Well-Known Member

    Messages:
    231
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Try this
    change according to ur requirement
    this worked for me

    <?php
    @extract($_POST);
    $name = stripslashes($name);
    $email = stripslashes($email);
    $subject = stripslashes($subject);
    $text = stripslashes($text);
    mail('haradeep@gmail.com',$subject,$text,"From: $name <$email>");
    header("location:index.php");
    ?>
     
    haradeep, Dec 14, 2008 IP
  3. jinxin

    jinxin Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    suggest using the phpmailer
     
    jinxin, Dec 14, 2008 IP