Title: class-phpmailer.php problem with function EncodeHeader
Last modified: August 20, 2016

---

# class-phpmailer.php problem with function EncodeHeader

 *  [guylevy](https://wordpress.org/support/users/guylevy/)
 * (@guylevy)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/class-phpmailerphp-problem-with-function-encodeheader/)
 * Hello.
    I’ve recently installed a new wp website (Hebrew language). However I’ve
   encountered a problem with new user registration, the users never received the
   email from the system. After checking with my host and making sure that a simple
   php mail script is being sent I’ve tried to debug the code and ended up in class-
   phpmailer.php on
 *     ```
       $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
       ```
   
 * when removing the EncodeHeader the mail is sent properly. I’ve tried to debug
   this further but couldn’t figure out the exact problem.
    It seems that the EncodeHeader
   function breaks the headers and the mail function fail sending the email. I’ve
   seen this error repeating on several post as “could not instantiate mail function”.
   the users are usually guided to use smtp instead of php mail.

The topic ‘class-phpmailer.php problem with function EncodeHeader’ is closed to 
new replies.

## Tags

 * [Could not instantiate mail function.](https://wordpress.org/support/topic-tag/could-not-instantiate-mail-function/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [guylevy](https://wordpress.org/support/users/guylevy/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/class-phpmailerphp-problem-with-function-encodeheader/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
