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

Category: Resources

JackCarr
Asked:
2013-09-17 11:50 am EST

Hits: 1,021
Using the tutorial by Brad Markle on one of your tutorial pages at: http://www.inmotionhosting.com/support/email/send-email-from-a-page/using-phpmailer-to-send-mail-through-php, 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() [function.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: www.carrscorner.com/testemail.html

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

0

Arn
Staff
17,283 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:

//require("lib/PHPMailer/class.phpmailer.php");
require("lib/PHPMailer/PHPMailerAutoload.php");

(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.

Regards,
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.
JackCarr
8 Points
2013-09-17 6:05 pm EST
Like this Question?

Need more Help?

Search

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!