Add from field in php form

Discussion in 'Coding Help' started by links, Dec 8, 2011.

  1. links

    links New Member

    I currently have a form that I am using on a site, however I would like to add code so my Gmail knows that it is arriving from a safe address. some emails have been going into the spam folder. Can you assist please

    I tried to place email address in below code but no joy.

    $headers .= 'From: '.$cf_email."\r\n";
  2. dropbop

    dropbop New Member

    This is how I use it and it works fine :)

    $to = "";
        $subject = "This is an email subject";
        $from = "";
        $headers = "From:" . $from;
        $body = "
        Hi $name,\n\n 
        Thank you for visiting my website etc etc etc. \n\n 
        mail($to, $subject, $body, $headers);

Share This Page