Title: trouble using php mail function to post by email
Last modified: August 19, 2016

---

# trouble using php mail function to post by email

 *  [cthress](https://wordpress.org/support/users/cthress/)
 * (@cthress)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/php-mail-function-for-post-by-email/)
 * I’m having trouble with a php script I wrote that takes advantage of the post
   by email functionality built into WordPress, and I was hoping someone might be
   able to help.
 * I created a form for my company, where our customers can enter a title, blog 
   content, and upload an image to add entries to their WordPress (or other platform)
   blog. The form takes advantage of the post by email functionality built into 
   WordPress and most other major blogging platforms. The form includes fields for
   a “from” address and “to” address, too, so the PHP mail script knows where to
   submit the results.
 * I’ve tested the form on multiple platforms (not just WordPress), and it seems
   to work for virtually every platform, except WordPress. When I submit the form
   using a “to” address that is tied to one of my test WordPress blogs, the mail
   function returns true, indicating that the mail was successfully sent, but the
   post does not appear on the WordPress blog, either as a draft or as a live post.
   I get the same results on both a self-hosted WordPress blog and on a WordPress-
   hosted blog.
 * However, if I set the “to” address to my own email address and then forward the
   email I receive to my special WordPress-generated email address, it posts just
   fine. I’ve tested this both with and without the image upload to see if that 
   makes any difference, but it doesn’t seem to matter.
 * Anyway, I checked the forums to see if anyone else had encountered this issue
   before, but I didn’t see any open cases. So I thought I’d go ahead and start 
   a new ticket.
 * If anyone has encountered this and knows how to solve it (or if it’s something
   that can’t be resolved), please let me know. I’d be happy to provide my php script
   if that helps.
 * Thanks,
 * Carl

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

 *  [Peter Westwood](https://wordpress.org/support/users/westi/)
 * (@westi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/php-mail-function-for-post-by-email/#post-1975737)
 * I’m not sure whether you are referring to issues with WordPress.com or a self-
   hosted WordPress.org install.
 * If WordPress.com you need to contact WordPress.com support – [http://en.support.wordpress.com/contact/](http://en.support.wordpress.com/contact/)
 * If WordPress.org we need more information about how you are configured to help
   you diagnose but the post-by-email support in core is not in current development
   and only works with a small subset of email providers
 *  Thread Starter [cthress](https://wordpress.org/support/users/cthress/)
 * (@cthress)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/php-mail-function-for-post-by-email/#post-1975756)
 * Both, really. The form I created (and associated PHP script) simply generates
   an email that gets sent to whatever email address the person filling out the 
   form provides. Any images uploaded through the form are sent as attachments on
   the email message.
 * If I’m reading your response correctly, it sounds like what I’m trying to do 
   might not be supported by WordPress. If that’s the case, please let me know. 
   Thanks!

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

The topic ‘trouble using php mail function to post by email’ is closed to new replies.

## Tags

 * [mail](https://wordpress.org/support/topic-tag/mail/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [php mail](https://wordpress.org/support/topic-tag/php-mail/)
 * [php mail function](https://wordpress.org/support/topic-tag/php-mail-function/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [cthress](https://wordpress.org/support/users/cthress/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/php-mail-function-for-post-by-email/#post-1975756)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
