Title: Illegal string offset &#8216;attachments&#8217;
Last modified: August 17, 2017

---

# Illegal string offset ‘attachments’

 *  Resolved [oldmankit](https://wordpress.org/support/users/oldmankit/)
 * (@oldmankit)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/)
 * Eight months ago I posted this [issue](https://wordpress.org/support/topic/illegal-string-offset-headers/)
   about a warning that appears on the front end of my sites when activating the
   email log plugin.
 * I waited for a while (eight months!) to see if this had been fixed. Well, now
   I get three more warnings from the front end, eek. (I just updated the plugin
   to 2.0.2):
 *     ```
       Warning: Illegal string offset 'attachments' in root/wp-content/plugins/email-log/include/Core/EmailLogger.php on line 48
   
       Warning: Illegal string offset 'to' in root/wp-content/plugins/email-log/include/Core/EmailLogger.php on line 49
   
       Warning: Illegal string offset 'subject' in root/wp-content/plugins/email-log/include/Core/EmailLogger.php on line 50
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fillegal-string-offset-attachments%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * (@sudar)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9417647)
 * The original issue that you reported and the current warnings that you have reported
   are happening because the argument array that is sent to wp_mail filter is not
   having the required fields as mentioned in the documentation ([https://developer.wordpress.org/reference/hooks/wp_mail/](https://developer.wordpress.org/reference/hooks/wp_mail/))
 * The reason why I am not checking whether these values are not available in the
   array before accessing them is because they are expected to be there according
   to the WordPress documentation.
 * My guess is that this is mostly caused either by another plugin that hooks into
   the wp_mail filter and changes it or by the plugin that generates these emails.
 * Even though these warnings are happening because of another plugin I will try
   to fix them in my code if possible since in the error message it appears as if
   the warnings are generated by my plugin 🙂
 * Thanks for reporting these issues. I have created another github issue to track
   this [https://github.com/sudar/email-log/issues/99](https://github.com/sudar/email-log/issues/99)
   and it will be released as part of the next release in a couple of weeks.
 * The original issue that you reported has been fixed and is already part of the
   v2.0.2.
 *  Thread Starter [oldmankit](https://wordpress.org/support/users/oldmankit/)
 * (@oldmankit)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9423243)
 * Thanks Sudar for explaining so clearly what’s going on. That makes perfect sense.
 *  [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * (@sudar)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9515875)
 * We just released v2.1.0 of the plugin with additional checks to prevent the above
   warnings.
 * Please update the plugin and let us know if you still see any PHP warnings.
 *  Thread Starter [oldmankit](https://wordpress.org/support/users/oldmankit/)
 * (@oldmankit)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9523196)
 * After re-activating, the problem is solved. Thank you so much for doing this.
   I’m happy to have email log back up and running on all my sites!
 *  [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * (@sudar)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9523246)
 * Thanks for trying out the update and for confirming that everything works properly
   now.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Illegal string offset ‘attachments’’ is closed to new replies.

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

 * 5 replies
 * 2 participants
 * Last reply from: [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/illegal-string-offset-attachments/#post-9523246)
 * Status: resolved