Title: Code Error
Last modified: February 7, 2024

---

# Code Error

 *  [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/code-error-41/)
 * Hi,
 * I have raised this before with you by email but nothing has been done. I believe
   there is an issue with the code of this plugin which creates php errors when 
   emails do not send due to a server problem.
 * The code below comes at the end of transmail.php. First it tries to get the variable
   $details from $responseData. However if there is no server connection then $responseData
   is not present so it throws up an error. Secondly it seems you are using $message
   for two different items. The first is the error message and the second is the
   email message as part of $mail_data.
 * Please do not ask me to email your team with this as I have done it before and
   nothing was done.
 *     ```wp-block-code
       if($http_code == '200' || $http_code == '201') {
         return true;
       }
   
       $details = $responseData->error->details;
       $message = $details[0]->message;
   
       $mail_data = array(
         'to' => $to,
         'subject' => $subject,
         'message' => $message,
         'headers' => $headers1,
         'attachments' => $attachments
       );
   
       do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $message, $mail_data ) );
       return false;
       ```
   
 * My current workaround to avoid php errors and be able to correctly log when emails
   are not sent in my mail logger is this.
 *     ```wp-block-code
       if($http_code == '200' || $http_code == '201') {
         return true;
       }
       /*
       $details = $responseData->error->details;
       $message = $details[0]->message;
       */
       $mail_data = array(
         'to' => $to,
         'subject' => $subject,
         'message' => $message,
         'headers' => $headers1,
         'attachments' => $attachments
       );
   
       do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', 'No Response from Server', $mail_data ) );
       return false;
       ```
   
 * If I am wrong about this then please accept my apologies.
 * Many thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Zoho Mail](https://wordpress.org/support/users/zmintegration/)
 * (@zmintegration)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/code-error-41/#post-17412821)
 * Hello there,
 * Sorry to hear that. Our backend team is working on the issue and the same will
   be fixed in our upcoming update. Kindly bear with us till then.
 * Regards,
   ZeptoMail team

Viewing 1 replies (of 1 total)

The topic ‘Code Error’ is closed to new replies.

 * ![](https://ps.w.org/transmail/assets/icon-256x256.png?rev=2372126)
 * [Zoho ZeptoMail](https://wordpress.org/plugins/transmail/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/transmail/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/transmail/)
 * [Active Topics](https://wordpress.org/support/plugin/transmail/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/transmail/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/transmail/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Zoho Mail](https://wordpress.org/support/users/zmintegration/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/code-error-41/#post-17412821)
 * Status: not resolved