Post by Email using php mail() function

  • Author
  • #627361


    I am trying to create a page to post articles via e-mail.

    the code is like;

    $body = $_SESSION[‘rss_fullcontent’];
    $sender = ‘(my e-mail address)’;
    $SMTP_Valid = new SMTP_validateEmail();
    $result = $SMTP_Valid->validate(“(the secret e-mail address)”, $sender);
    if ($result[0]) {
    $mail = new PHPMailer();
    $mail->Host = “”;
    $mail->From = “‘(my e-mail address)”;
    $mail->FromName = “(My name)”;
    $mail->Sender = “‘(my e-mail address)”;
    $mail->AddAddress(“(the secret e-mail address)”);
    $mail->Subject = $subject;
    $mail->Body = $body;
    $mail->AltBody = strip_tags($body);

    if(!$mail->Send()) {
    $problems=”Failed to send to “.”(secret address)” – Mailer Error: ” . $mail->ErrorInfo;
    } else {
    $problems=”Failed to send to “.”(secret address)”. ” – “.$result[1][0];
    echo $problems;
    if ($problems) {

    } else {


    I have been successfull on other blog site, but it doesn’t work on
    There was no error showing, it’s just not updating.
    I tried e-mailing via mail client (outlook), it worked perfectly.

    Would you tell me what is causing this problem?

    The blog I need help with is



    If you are really doing that type of code you are not hosted on WordPress.COM.

    The site linked to your name does not appear to be hosted on WordPress.COM, this site is for support of sites hosted on WordPress.COM. You should make friends and address your questions to WordPress.ORG the keepers of the software you are using:

    For more on the difference:

    If you are talking about a WordPress.COM hosted blog, then we need a link beginning with http to that blog please.


    This code is from outsite or

    I am just e-mailing from a page in a completely different server, and it is working for other blog sites such as Blogspot, Type Pad etc.

    This is the address of the blog.


    Is anyone can answer my question?



    The site you gave us businessinsure the “” has been suspended somehow you ended up not following the rules of some sort. Did you read the code of conduct?

    Administrator of



    @businessinsure is no longer available.
    This blog has been archived or suspended for a violation of our Terms of Service.
    For questions or concerns, contact Support.

    I’m sorry but this is not a matter for posting to a public forum. We Volunteers answering support questions have no role to play in this process. This is between you and Staff. You have a warning notice on your dashboard with a link in it. Please click that link.

    If you contacted Staff by using the “click here to contact us” link in the notice, the ToS department definitely received your request. Please be patient as they’ll be getting back to you as soon as they can.

    Reference links:

    As a policy, please refrain from discussing ToS issues on the public forums. Thank you for your patience.

The topic ‘Post by Email using php mail() function’ is closed to new replies.