Saturday, July 30, 2016

Wordpress Fatal error: Call to undefined method PHPMailer::getCustomHeaders()


With numerous new themes and new versions of the wordpress, when you try to publish some post or page or try to send email or try to use contact form, you might get following error:


Fatal error: Call to undefined method PHPMailer::getCustomHeaders()







This error normally occurs if you are using incompatible wordpress and theme and plugin versions. The best course of action is to update your wordpress, your theme, and all the plugin and make sure that contact form 7 plugin isn't complaining about the wordpress version.

If you cannot upgrade your versions or if the error is occuring even after the upgrade, then you can do the following workaround:

Workaround:

Make the following change in your mail.php file in the directory wordpress/wp-content/plugins/contact-form-7/includes

Go to the line 171 and change:
 
add_action( ‘phpmailer_init’, ‘wpcf7_phpmailer_init’ );


to
 

//add_action( ‘phpmailer_init’, ‘wpcf7_phpmailer_init’ ); 

Hope that helps.

12 comments:

Karthika Shree said...

This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
Java Training in Chennai

sunitha vishnu said...


This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Jack son said...

So it is required that subjects and modules must be good with the most recent form of WordPress. https://www.templatemonster.com/blog/profitable-upwork-projects-web-designers/

Adiba Alam said...

It is the obligation of the system organization to discharge the refreshed and perfect adaptation of topic, when you are utilizing paid subject.https://www.templatemonster.com/blog/periodic-table-of-html-tags-infographics/

alex mark said...

Be that as it may, this does not occur with free subjects; here you need to sit tight for a month to see an update. All the paid subject creator offers free support, however in free topics, you can't expect a free support. https://www.templatemonster.com/blog/make-first-money-internet/

seo boss said...

Absence of additional component and usefulness If you are searching for some additional element and usefulness in free topic then you need to baffle. https://www.templatemonster.com/blog/raising-brand-awareness-get-noticed-across-social-media/

Philip T. Greene said...

Security chance WordPress refresh innovation consistently, the paid topics are refreshed and no security issue. https://www.templatemonster.com/blog/start-product-review-site/

Keith A. Grant said...

In free topics, engineers top off topic document with malevolent codes and spam joins, which brings about terrible client encounter.
https://www.templatemonster.com/blog/templatemonster-story-ebook/

Betty M. Dickerson said...

Bolster Premium WordPress subject accompanies lifetime bolster. You will find solutions to the vast majority of your inquiries in the bolster gatherings. https://www.templatemonster.com/blog/how-to-create-prestashop-store/

Patricia P. McNeil said...

Security-Premium subjects are produced by constant WordPress engineers taking after strict and high web standard coding. So no security vulnerabilities here, which implies you don't have to stress over any noxious and spam joins. https://www.templatemonster.com/blog/create-shopify-store/

Andrea R. Williams said...

Additional component and usefulness Premium subject accompanies expanded elements and functionalities including gadgets, augmented capacities and considerably more. Typically these topics are anything but difficult to alter and developed.
https://www.templatemonster.com/blog/creado-grid-css-wordpress-theme/

seo boss said...

Search engine optimization SEO is the basic piece of advanced advertising, Web outline and improvement organization accentuate on premium subject, since premium topics are upgraded for the site and offer inbuilt SEO alternative. https://www.templatemonster.com/blog/how-to-create-woocommerce-store/