title: Adding Custom Header using phpmailer
body: <p>I have a contact form which a user types his/her details including his/her email, the code below works well</p>
  
  <pre><code> $mail             = new PHPMailer();
                $body             = $message;
                $mail-&gt;IsHTML(true);
                $mail-&gt;SMTPAuth   = true;
                $mail-&gt;Host       = "smtp.bizmail.yahoo.com";
                $mail-&gt;Port       = 587;
                $mail-&gt;Username   = "name@domainname.net";
                $mail-&gt;ContentType ='text/html';
                $mail-&gt;Password   = "password";
                $mail-&gt;SMTPSecure = 'tls';
                $mail-&gt;SetFrom('name@domainname.net', 'my name',false);
                $mail-&gt;Subject    = $subject;
  
                $mail-&gt;MsgHTML($body);
                $mail-&gt;IsSMTP();
                $address = $to;
                $mail-&gt;AddAddress($address, $name);
                if(!$mail-&gt;Send()) {
                    return 0;
                } else {
                      return 1;
               }
  </code></pre>
  
  <p>this code sends a mail and a header "From: name@domainname.net", but i want to show the email the user inputs from the contact form. e.g a user inputs myenquiry@anotherdomain.com, i want the from mail to be "From: myenquiry@anotherdomain.com" in which anotherdomain is not in my domain (i.e yahoo small business)</p>