Menu

senders email address

Help
2009-03-27
2013-06-03
  • seth meyerowitz

    seth meyerowitz - 2009-03-27

    i need to have the person's email address show as the "from" when i receive the emails.  i want to have an autoresponder set up but cant do that until i get it done.

    please advise.

    thanks

    seth

    <?php

    $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

    session_start();
    if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
    mail("firstsendtoemail@email.com, secondsendtoemail@email.com","Contact Us Form ","Form data:

    Name: " . $_POST['field_1'] . "
    Phone (123)-456-7890: " . $_POST['field_3'] . "
    Reason For Contact: " . $_POST['field_7'] . "
    Email Address: " . $_POST['field_8'] . "
    ", "From: theaddresstoshowinthefrom@email.com\r\n");

    include("confirm.html");
    }
    else {
    echo "Invalid Security Code.  Please go back and try again.";
    }

    ?>

     
    • Aaron Hardy

      Aaron Hardy - 2009-03-27

      I believe

      mail("firstsendtoemail@email.com, secondsendtoemail@email.com",$_POST[field_8],"Contact Us Form ","Form data:

      Try that and see if it works, I'm not a php developer, but it worked for one of my forms, but it didn't on another one.

       
    • seth meyerowitz

      seth meyerowitz - 2009-03-27

      thats putting the users email as the subject...

       
    • seth meyerowitz

      seth meyerowitz - 2009-03-27

      is there any order ?? if so, where does the users email address go?

      mail("sendto","subject","form data")

      the way that i have it, (which sends from an email that i set up "form@mydomain.com") it is after the form data

      mail("sendto","subject","form data","from: form@...com")

       
    • TNTEverett

      TNTEverett - 2009-03-27

      Look for this text
      "Code below works without errors"
      at the site below for a good example.
      http://php.net/mail

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.