InMotion Hosting Support Center

PHPMail - Warning: Wrong datatype... /class.phpmailer.php

Category: Resources

2013-09-17 11:50 am EST

Hits: 1,358
Using the tutorial by Brad Markle on one of your tutorial pages at:, I used his code to create a test email form and when it gets submitted, it sends an email, but leaves the following error: Warning: in_array() []: Wrong datatype for second argument in /home/carrsc5/public_html/lib/PHPMailer/class.phpmailer.php on line 574
Message has been sent
The test email page is at:

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

You must login before you can submit an answer.

Best answer chosen by User


37,289 Points
2013-09-17 1:50 pm EST
Hello Jack,

Apologies for the problem you've been having with the PHPMailer after following our directions. I actually sat down with Brad (the author of this article) to figure out what was going on with the script. We finally narrowed it down to the following lines in your email.php file:


(this is fixed in the article Using phpMailer to Send Mail through PHP .

The second line is the correct one - we discovered that the instructions for PHPMail have apparently been updated and now require this line (lines 10 and 11 in your code). I have already added it (as per above ) to your file. I've also verified that this fixes the problem that you're seeing.

I have already updated the article to reflect this requirement! Our apologies again for the problem! And our thanks for identifying an issue that needed to be fixed in our documentation.

Thanks again for your patience, and please let us know if you require any further assistance.

Arnel C.

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

This indeed solved the problem and I'll now be able to incorporate into the actual contact form it is intended to be use with. Thank you for your time and effort.
8 Points
2013-09-17 6:05 pm EST
Like this Question?

Support Center Login

Social Media Login

Social Login Joomla

Related Articles

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:
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!