Enable PHP Mail() in cPanel (sendmail_path Fix) | Hosticko #
Enable PHP Mail() only if you absolutely must. PHP mail() has a low delivery success rate compared to SMTP,
and it’s more likely to land in spam. If you can, use authenticated SMTP (recommended) instead.
Important: Sending email via PHP mail() often has poor deliverability. For business emails, newsletters, and website notifications,
SMTP is the correct approach.
Need help enabling it or moving to SMTP the right way? Submit a ticket:
https://client.hosticko.com/submitticket.php
What PHP Mail() does (and why it’s discouraged) #
PHP mail() sends messages using the server’s local mail transfer agent (sendmail-compatible).
On many hosting environments, it’s restricted, rewritten, or heavily filtered because it’s frequently abused by compromised scripts.
- Deliverability risk: messages sent by
mail()are more likely to be marked as spam. - Abuse risk: a hacked contact form can send spam through
mail()quickly. - Limited control: less visibility, weaker authentication alignment, and harder troubleshooting vs SMTP logs.
How to enable PHP Mail() in cPanel (sendmail_path) #
To enable PHP mail() on Hosticko, you typically adjust the sendmail_path value in your account’s PHP Selector options.
(This is the same “Select PHP Version” interface used in many cPanel + CloudLinux environments.)
- Log in to cPanel.
- Open Select PHP Version (sometimes called PHP Selector).
- Click the Options tab.
- Find sendmail_path and set it to:
/usr/sbin/sendmail -t -i - Save/apply changes.
If you don’t see “Select PHP Version” in cPanel, your server may be using a different PHP manager.
In that case, open a ticket and we’ll tell you the exact method for your hosting environment.
How to test PHP Mail() #
After enabling it, do a simple test from your website/application (or a small test script). Keep the test minimal and avoid spam-like content.
- Send to a mailbox you control (example: a Gmail inbox you can check).
- Use a basic subject like “Hosticko PHP mail test”.
- Check the inbox and the spam folder.
If it lands in spam consistently, that’s a strong sign you should switch to SMTP.
Recommended: use SMTP instead (better inbox placement) #
If you’re sending emails from WordPress, a contact form, a CRM, or any app, SMTP is the correct setup.
SMTP authentication improves trust and gives more stable delivery than PHP mail().
Best options #
- Use your Hosticko mailbox via SMTP (ideal for normal website notifications).
- Use a dedicated transactional provider (ideal for higher volume): SendGrid, Mailgun, etc.
- Use a library like PHPMailer to send via SMTP from PHP apps.
Helpful reference for SMTP sending via PHPMailer (cPanel guide):
Using PHPMailer to send via SMTP (cPanel)
Troubleshooting #
PHP Mail() still doesn’t send #
- Double-check sendmail_path is exactly
/usr/sbin/sendmail -t -i. - Confirm your script is actually using
mail()and not an SMTP library. - Check if your app has a “mail method” setting (some apps default to SMTP and ignore
mail()). - If you’re using WordPress, don’t rely on PHP Mail—use SMTP instead.
Emails send but land in spam #
- Switch to SMTP (seriously — this is the common outcome for PHP
mail()). - Publish SPF/DKIM/DMARC for your domain and keep them aligned with your sender.
- Avoid spammy subjects, too many links, and image-only content.
Sudden spikes / sending blocks #
- Scan your site for compromised forms or scripts.
- Review outgoing mail logs if available (or contact Support for a sending audit).
If you’re stuck, send your domain name + what you’re trying to send (WordPress, PHP app, contact form, etc.) here:
https://client.hosticko.com/submitticket.php
FAQs #
Is enabling PHP Mail() recommended? #
No. It’s usually a last resort. SMTP is more reliable and has much better inbox placement.
Will enabling PHP Mail() fix my contact form emails? #
It might make them send, but it often makes deliverability worse. SMTP is the correct fix for contact form delivery issues.
Can Hosticko enable this for me? #
Yes — open a ticket and we’ll confirm the best option for your server (PHP Mail or SMTP), and help you set it correctly.
