• jimtturner

    (@jimtturner)


    Trying to send myself an email whenever my ‘message’ page is loaded using the Code Snippets Plugin. I’ve searched forums and google for an example and have tried a few different ideas but so far nothing works. This is the latest code I have tried:

    if(is_page(‘message’))
    {

    $fromName = ‘Auto email notification system’;

    $subject = ‘Confirmed’;

    /* Mail Address / $toAddr = ‘[email protected]’; $bccAddr = ‘[email protected]’; $fromAddr = ‘[email protected]’; / End Mail Address */

    /* Mail Body */
    $msg = ‘
    my messages about confirmation…
    ‘;

    $msg = wordwrap($msg, 70);
    /* End Mail Body */

    /* Mail Headers Setup / $headers = array(); $headers[] = “MIME-Version: 1.0”; $headers[] = “Content-type: text/html; charset=utf-8”; $headers[] = “From: “.$fromName.” <“.$fromAddr.”>”; $headers[] = “Bcc: <“.$bccAddr.”>”; / End Mail Headers Setup */

    mail($toAddr, $subject, $msg, implode(“\r\n”, $headers));

    }

    The page I need help with: [log in to see the link]

  • The topic ‘Code Snippets Plugin’ is closed to new replies.