Viewing 5 replies - 1 through 5 (of 5 total)
  • Pls Change PHPmailer Function
    Find in root/wp-includes/class-phpmailer.php

    private function mail_passthru($to, $subject, $body, $header, $params) {
        if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) {
            $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
        } else {
            $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
        }
        return $rt;
      }

    replace with

    private function mailPassthru($to, $subject, $body, $header, $params)
        {
    		$subject= trim(str_replace(array("\r", "\n"), '', $subject));
            if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
                $rt = @mb_send_mail($to, $subject, $body, $header);
            } else {
                $rt = @mb_send_mail($to, $subject, $body, $header, $params);
            }
            return $rt;
        }
    Thread Starter darshan.cws

    (@darshancws)

    What is its meaning.. I dind understood

    The problem not related to contact form 7
    problem is from web hosting
    after check your mail@address
    change “@mail” function to “@mb_send_mail” for fix mail sending

    Thread Starter darshan.cws

    (@darshancws)

    I changed like following

    private function mailPassthru($to, $subject, $body, $header, $params)
        {
            $subject= trim(str_replace(array("\r", "\n"), '', $subject));
            if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
                $rt = @mb_send_mail($to, $subject, $body, $header);
            } else {
                $rt = @mb_send_mail($to, $subject, $body, $header, $params);
            }
            return $rt;
        }

    Still not receiving mail

    test mail function
    testmail.php

    <?php
    // The message
    
    $sendto = "[email protected]";
    $subject = "php mail test";
    $message = 'Test message using PHP mail()';
    $header = "From: webmaster@".$_SERVER["SERVER_NAME"]."\n";
    $header .= "Content-Type: text/html; charset=utf-8\n";
    
    $message = 'Test message using PHP mail()';
    $subject='Test';
    // Send
    if (mail($sendto,$subject,$message,$header, "-fwebmaster@".$_SERVER["SERVER_NAME"]))
    {
     echo 'Mail sent!';
    } else
    {
     echo 'Error! Mail was not sent.';
    };
    ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Mail not received on gmail from Contact Form 7’ is closed to new replies.