Programatically posting via e-mail to a wordpress.com hosted blog

  • Unknown's avatar

    I’m trying to post by e-mail with the e-mail being generated by a php script on another site.
    This is the code I’m using:

    $to = “(email visible only to moderators and staff), (email visible only to moderators and staff), (email visible only to moderators and staff)”;
    $subject = ” *** test message: ” . date(‘r’);

    $headers = “From: (email visible only to moderators and staff)” . “rn”;
    $headers .= “Reply-To: (email visible only to moderators and staff)” . “rn”;

    $headers .= “MIME-Version: 1.0” . “rn”;
    $headers .= “Content-type:text/html;charset=iso-8859-1” . “rnrn”;

    $message = “This is a test message”;

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

    print “

    " . date('r'). "nnmail to: $to nnn";	
    
    ?>
    
    Invoking this script sends e-mail to my msn account, my yahoo account, but apparently not to my wordpress-hosted blog.  
    
    Any ideas on what I'm doing wrong or where/how to troubleshoot?
    
    Thanks
    Jim Little
    jamesrlittle at msn.com

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    I see the e-mails got redacted above…but for the record the third address was the wordpress generated “secret” e-mail address for posting to the blog.

  • Unknown's avatar

    I also see that some backslashes got removed…but the “rnrn’s” above are backslash r backslash n etc… IE the php script works… the mail just seems to not be getting into the wordpress blog

  • The topic ‘Programatically posting via e-mail to a wordpress.com hosted blog’ is closed to new replies.