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

  • Answered
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:
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.