InMotion Hosting Support Center

I cannot send email with phpmailer on cpanel


busnurd
Asked:
2016-01-03 2:38 am EST

Hits: 3,571
When I entered these to send email with phpmailer on cpanel,
require 'phpmailer/PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->isSMTP();
$mail->Host = 'srv1.iphosting.co';
$mail->SMTPAuth = true;
$mail->Username = 'info@mydomain.com';
$mail->Password = '************';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
I received the following errors:
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Please help me out. Thanks

You must login before you can ask a follow up question.

You must login before you can submit an answer.

When I still change $mail->Host = 'srv1.iphosting.co'; to $mail->Host = 'localhost';
I received similar errror:
Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Someone to help me out please! Thanks
busnurd
5 Points
2016-01-03 03:28 am EST

OTHER ANSWERS

0

scott
Staff
43,761 Points
2016-01-04 4:32 pm EST
Hello busnurd,

Sorry to hear you are having issues with your phpmailer's SMTP conection. The documentation link you provided says "It means that PHPMailer is unable to contact the SMTP server you have specified in the Host property". You will want to first ensure all credentials are correct. If not, you will want to check the documentation link provided to see what steps to take next, such as adding additional parameters for more thorough error reporting.

Kindest Regards,
Scott M

You must login before you can post a comment about this answer.

Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!