PHP mail function 'from' address

后端 未结 3 1295
庸人自扰
庸人自扰 2020-11-29 09:38

I\'m not even sure this is possible, however what I\'m trying to do is as follows. I have an HTML form that generates and email using a PHP script. What I want

3条回答
  •  再見小時候
    2020-11-29 09:46

    For a php mail script I have used this for contact forms:

    $from = $_POST["from"];  //posted from the form.
    
    mail("me@myname.com", $subject, $message, "From:" . $from);
    

    I have not used a sendmail_from in my php before, only a simple variable.

    I hope this helps!

提交回复
热议问题