I'm designing a contact page in my website, where the user enters their email address, message and name. I want the message from the user to be send to my websites email. The email looks something like this: contact@name.com
I have used the mail() function in PHP, but it doesn't work, and it doens't give me any errors. Is this posible with the PHP mail() function or do I need to download something like PHPMailer?
The reason I want this message to be sendt to my email address is that I will easily be able to reply to the emails.
Asked
Active
Viewed 20 times
0
Hewr Chelsea
- 129
- 1
- 7
-
Check the Mail logs of your server. Especially if you're using shared hosting, the emails may be getting blocked/marked as spam. The best things to do are enable SPF, DKIM, and DMARC records on your domain, and/or use a third party sending tool like SendGrid or MailGun. PHP Emails are notoriously finnicky due to years of people abusing forms to send spam. – Xhynk Dec 01 '20 at 21:35
-
*Try* first, then ask us how to fix what you've tried. The PHPMailer tag you tagged this question with contains a link to the project which contains plenty of docs and examples. [Start here](https://github.com/PHPMailer/PHPMailer#installation--loading). – Synchro Dec 01 '20 at 22:12