PHP Form Message

后端 未结 4 1755
逝去的感伤
逝去的感伤 2021-01-23 03:16

So I have a form:

4条回答
  •  情书的邮戳
    2021-01-23 03:36

    mail function returns a boolean (true/false), so you can do like this

    if (mail('myemail.co.uk', $email, $message)) {
        echo "Thank you. We will be in touch soon.";
    } else {
        echo "Something went wrong, the email was not sent!";
    }
    

    Also, the structure of mail (the parameters) are to-address, subject, message. Which means that your current subject is the email-address, I'm not sure if this is what you intended?

提交回复
热议问题