POST by email with PHP mail function

  • Author
  • #668470

    I want to post in with POST BY EMAIL functionality. I wrote a script to post it to blog, but my mail is not creating any new post but when I am sending mail via Gmail its creating a new post in what mistake I am doing. I could not understand.

    Here is my simple code :

    $to = “[post by email address removed]”;
    $subject = “About Politics”;
    $message = “Hello! This is About Politics.”;
    $from = “[email address removed]”;
    $headers = “From:” . $from. “\r\n”;
    $headers .= “To:” .”[post by email address removed]”. “\r\n”;
    $headers .= “Cc:” . “[email address removed]”. “\r\n”;

    echo mail($to,$subject,$message,$headers);


    Its a very basic code. I have tried with different HEADERS also but the result is same.
    please help me out from this issue.

    If , there is any alternative way then please suggest.

    Thanks in advance

    The blog I need help with is



    The posts will need to be sent through a real mail client or webmail service. We do not allow automated posting here at

    Also, I removed your post by email address from above. You should consider regenerating this before the spammers pick up on it.


    Thanks for your reply but I am not spammer. I have 3-4 blogs so how do I post to all blogs at a time or I have to post one by one.


    If you are duplicating content on those 3-4 blogs, you are killing your search engine ranking. Those 4 sites will compete against each other for ranking on the duplicate content, and all of the sites are going to be ranked much lower than would be the case if you had the content only on one site. Google might also decide on its own not to list 3 of the 4 at all, or relegate them to the very bottom of search results.

    Duplicate content on the web = always bad idea

    Also, even though you say you are “not spammer” how is wordpress supposed to sort out the “not spammers” from the “spammers”?



    macmanx said:

    Also, I removed your post by email address from above. You should consider regenerating this before the spammers pick up on it.

    You should regenerate (recreate/redo) the email address that you posted in your example of the php you were trying to use. Spammers can pick up that email address and use it to spam your blog with posts. The email address that you use to post to your blog should remain private to you only, otherwise, others can access your account and post material that you do not approve.

    As for whether you’re a spammer, that’s not really the issue that thesacredpath is addressing — although since spammers and scrapers also used automated posting, that is a reason for to not allow automated posting — you are better off posting content to only one of your blogs. Keep the content on each blog unique. You can always post a link to another blog post on a different blog, if you want to direct readers of that blog to another blog.

    I have to say that I don’t understand the point of having four identical blogs all hosted at the same host.

The topic ‘POST by email with PHP mail function’ is closed to new replies.