Menu

How to change the From field

Help
2008-11-01
2013-06-03
  • Jack Andrews

    Jack Andrews - 2008-11-01

    How do I change the From in my form's reply to me. It has this now, but delivers "Apache User"

    [code]<?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('jack@andrewsontheweb.com','AB Moving Price Request','AB Moving Quote Form',"Form data:

    Your first name:: " . $_POST['field_1'] . "
    Your last name: " . $_POST['field_2'] . "
    Your email address:: " . $_POST['field_3'] . "
    Phone:: " . $_POST['field_4'] . "
    Fax:: " . $_POST['field_5'] . " [/code]

     
    • Musawir Ali

      Musawir Ali - 2008-11-08

      append a header parameter to the list of arguments to mail().

      so go to where mail finishes:

      mail('jack@andrewsontheweb.com','AB Moving Price Request','AB Moving Quote Form',"Form data:

      ...
      ...

      );

      change that last line to:

      , "From: someone@somewhere.com\r\n");

       

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.