Using HTML and PHP to send form data to an email

前端 未结 4 1951
感情败类
感情败类 2021-01-03 15:01

Like the title says, sending a form to my email. I get no errors, but the email never comes. Here\'s my HTML form (I don\'t think you\'ll need anything else, but there is al

4条回答
  •  太阳男子
    2021-01-03 15:22

    The problem is with your From field in your $headers variable. you can't just put any email address in there. For example: you are supposed to put an existing email address of your server that you create. Or if you want to use a gmail account in from field, you need to configure your gmail username and password with your server first before using that email.

    The simplest solution is to create a new email address on your hosting server and then put that email address in your from field in $headers variable.

    I've already mentioned it in details here.

提交回复
热议问题