'Uncaught Error: Call to undefined function PHPMailer\PHPMailer\mail() in /home/stitchon/public_html/wp-includes/PHPMailer/PHPMailer.php:874
I am getting the above error upon submitting my registration form. I'm not quite sure what I'm overlooking. If I could get some direction and help on this, that would be wonderful. Thanks!
858. private function mailPassthru($to, $subject, $body, $header, $params)
859. {
860. //Check overloading of mail function to avoid double-encoding
861. if (ini_get('mbstring.func_overload') & 1) { // phpcs:ignore
PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
862. $subject = $this->secureHeader($subject);
863. } else {
864. $subject = $this->encodeHeader($this->secureHeader($subject));
865. }
866. //Calling mail() with null params breaks
867. $this->edebug('Sending with mail()');
868. $this->edebug('Sendmail path: ' . ini_get('sendmail_path'));
869. $this->edebug("Envelope sender: {$this->Sender}");
870. $this->edebug("To: {$to}");
871. $this->edebug("Subject: {$subject}");
872. $this->edebug("Headers: {$header}");
873. if (!$this->UseSendmailOptions || null === $params) {
874. $result = @mail($to, $subject, $body, $header);
875. } else {
876. $this->edebug("Additional params: {$params}");
877. $result = @mail($to, $subject, $body, $header, $params);
878. }
879. $this->edebug('Result: ' . ($result ? 'true' : 'false'));
880. return $result; }
/**
* Output debugging info via a user-defined method.
* Only generates output if debug output is enabled.
*
* @see PHPMailer::$Debugoutput
* @see PHPMailer::$SMTPDebug
*
* @param string $str
*/
Solution 1:[1]
I've had this problem when using wordpress, previously I used PHP version 8.0, after changing to PHP version 7.4 finally the problem was resolved.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ajie Ikrus Kusumadhany |