Fatal error: Uncaught Error: Call to undefined function PHPMailer
-
Hello guys,
I am building my forms in my website and after some work I went ahead and tried to submit a message and unfortunately I am getting fatal errors again [again because I was getting them on other occasions and I had to update to php 8 from 7.4 according to my host , problems went away but not with contact form 7 again these arise. I went ahead and also checked another contact form which also gave me an error without specifying the actual error like cf7 did. Please note that , previously I went through the css js loading only when necessary with:
if (!is_front_page() && !is_home() && is_page() ) {
if ( function_exists( ‘wpcf7_enqueue_scripts’ ) ) {wpcf7_enqueue_scripts();}
if ( function_exists( ‘wpcf7_enqueue_styles’ ) ) {wpcf7_enqueue_styles();}
}
In functions.php
anddefine( ‘WPCF7_LOAD_JS’, false );
define( ‘WPCF7_LOAD_CSS’, false );
in wp-config.php .
I tried to erase these functions as this is the only step I took in terms of coding and the error would not appear anymore but then again another issue arose, the one of the gray spinning wheel without a delivery message or any other activity.
So, I would prefer to keep the js and css load off on the frontpage if possible and get rid of the following error.
”`Fatal error: Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php:872 Stack trace: #0 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1899): PHPMailer\PHPMailer\PHPMailer->mailPassthru() #1 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1639): PHPMailer\PHPMailer\PHPMailer->mailSend() #2 /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php(1470): PHPMailer\PHPMailer\PHPMailer->postSend() #3 /home/mywebsite/public_html/wp-includes/pluggable.php(531): PHPMailer\PHPMailer\PHPMailer->send() #4 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/mail.php(194): wp_mail() #5 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/mail.php(19): WPCF7_Mail->compose() #6 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(475): WPCF7_Mail::send() #7 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(93): WPCF7_Submission->mail() #8 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/submission.php(25): WPCF7_Submission->proceed() #9 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/contact-form.php(763): WPCF7_Submission::get_instance() #10 /home/mywebsite/public_html/wp-content/plugins/contact-form-7/includes/controller.php(25): WPCF7_ContactForm->submit() #11 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(290): wpcf7_control_init() #12 /home/mywebsite/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #13 /home/mywebsite/public_html/wp-includes/plugin.php(551): WP_Hook->do_action() #14 /home/mywebsite/public_html/wp-includes/class-wp.php(388): do_action_ref_array() #15 /home/mywebsite/public_html/wp-includes/class-wp.php(750): WP->parse_request() #16 /home/mywebsite/public_html/wp-includes/functions.php(1291): WP->main() #17 /home/mywebsite/public_html/wp-blog-header.php(16): wp() #18 /home/mywebsite/public_html/index.php(17): require(‘/home/mywebsite/…’) #19 {main} thrown in /home/mywebsite/public_html/wp-includes/PHPMailer/PHPMailer.php on line 872
There has been a critical error on this website.
Learn more about troubleshooting WordPress.`”
Please help.
Thanks
John
The topic ‘Fatal error: Uncaught Error: Call to undefined function PHPMailer’ is closed to new replies.