Fix mail() function in php website

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Felipe Gonzalez

Feedback score
1
Posts
60
Reactions
8
Resources
0
The PHP mail() can be pretty unreliable and that's why a lot of professionals don't bother with it. Instead opting for API-based email sending such as Mailgun and Sendgrid. You can also use SMTP sending through PHPMailer, which seems to be a bit more reliable, but can be slow as emails are often not send immediately depending on configuration.

https://www.jvfconsulting.com/blog/php-mail-function-vs-smtp-guaranteed-delivery/
Thanks but I am not interested in smtp can i get troubleshoot for mail() only?
 

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
Do you have SMTP credentials for mailing? Most public providers give you their SMTP credentials in case you need to send/receive emails through clients that don't support them by default.
 

Ryladine

Feedback score
0
Posts
9
Reactions
1
Resources
0
For $5 I'll take a look at your PHP errors and check to see if your domain is configured correctly, not going to fix it for you at that price though.

Add me on discord if you're interested in that, I can at least tell you what's wrong and point you in the correct direction for fixing it. Ryladine@8922
 

Zigenzag

Dev Ops Engineer
Supreme
Feedback score
4
Posts
215
Reactions
101
Resources
0
Do you get any errors from PHP? If so it would be helpful to see what they are. You may need to enable error displaying / logging

Are you sure the emails aren't getting delivered, if you haven't setup your DNS correctly you may not be receiving the emails as they will be marked as spam.

Check your SPF record is correct on the domain! Your SPF record should look like the following below (where 255.255.255.255 is your web servers IP)
Code:
v=spf1 ip4:255.255.255.255 -all

If you have an existing SPF record then you can just add the ip4:255.255.255.255 part after v=spf1 but before the end "strictness" -all / ~all etc
 
Status
This thread has been locked.
Top