How to configure a server to send email using cPanel? [duplicate]
Asked Answered
W

1

7

I am trying to send email using php. The mail is returning true. But I am receiving the email. So I am guessing that maybe there is some problem with the server. Is there any tutorial explaining how to configure the server to properly send email using cPanel?

My code is given below.

<?php

    $msg = "First line of text\nSecond line of text";
    $msg = wordwrap($msg,70);
    $headers = "From: [email protected]";
    mail("[email protected]", "My subject", $msg, $headers);
Webby answered 6/12, 2014 at 8:30 Comment(0)
M
2

Hi you might want to make sure first that your hosting provider allows you to send emails, try to see if their SMTP server is available, most hosting provider are available by default

Here's a tutorial for setting up smtp using phpmailer Send mail using phpmailer

Masters answered 6/12, 2014 at 8:46 Comment(4)
You may also want to consider using an email deliverability service like PostMarkApp to handle this for you.Cassino
mailchimp is my choice, but he is asking for a local cpanel configuration. Anyway, Yep, email delivery service are betterMasters
By mailchimp do you mean mandrill? (sorry off topic)Cassino
yep, that's their childMasters

© 2022 - 2024 — McMap. All rights reserved.