Click Here To Unsubscribe

EOF; $text_unsubscribe = "\r\n\r\nUnsubscribe: $GLOBALS[SITE_BASE_URL]/u.php?k=$unsub_key\r\n\r\n"; $headers = << X-Sender: <$GLOBALS[SITE_OWNER_EMAIL]> Return-Path: <$GLOBALS[SITE_OWNER_EMAIL]> Error-To: <$GLOBALS[SITE_OWNER_EMAIL]> X-Mailer: $_SERVER[SERVER_NAME] EOF; if( isset( $_POST[ 'message_type' ] ) && $_POST[ 'message_type' ] == 'html' ) { $headers .= <<
Click Here To Unsubscribe

EOF; $text_unsubscribe = "\r\n\r\nUnsubscribe: $GLOBALS[SITE_BASE_URL]/u.php?k=$unsub_key\r\n\r\n"; if( isset( $_POST[ 'unsubscribe_link' ] ) && $_POST[ 'unsubscribe_link' ] == 'yes' ) { if( $_POST[ 'message_type' ] == 'html' ) { $message .= $html_unsubscribe; } else { $message .= $text_unsubscribe; } } if( mail( $array[ 'email' ], $subject, $message, $headers ) ) { $succeeded++; } } else { $no_mail++; } $failed = sqlNumRows( $query ) - $succeeded - $no_mail; $return_message = "$succeeded email sent
$failed failed to send
"; } else { $return_message = "No email was sent, your query returned zero rows..
"; } } } else { $return_message = 'Errors were encountered.. no email was sent'; } } $subject = isset( $_POST[ 'subject' ] ) ? htmlentities( stripslashes( $_POST[ 'subject' ] ) ) : ''; $message = isset( $_POST[ 'message' ] ) ? htmlentities( stripslashes( $_POST[ 'message' ] ) ) : ''; $plain_text_checked = isset( $_POST[ 'message_type' ] ) && $_POST[ 'message_type' ] == 'plain_text' ? ' checked' : ''; $html_checked = isset( $_POST[ 'message_type' ] ) && $_POST[ 'message_type' ] == 'html' ? ' checked' : ''; if( !strlen( $plain_text_checked) && !strlen( $html_checked ) ) { $plain_text_checked = ' checked'; } $unsub_checked = isset( $_POST[ 'unsubscribe_link' ] ) && $_POST[ 'unsubscribe_link' ] == 'yes' ? ' checked' : ''; $unsub_not_checked = isset( $_POST[ 'unsubscribe_link' ] ) && $_POST[ 'unsubscribe_link' ] == 'no' ? ' checked' : ''; if( !$unsub_checked && !$unsub_not_checked ) { $unsub_checked = " checked"; } $sql = " SELECT email, first_name, last_name FROM $GLOBALS[TB_USERS] "; $query = sqlQuery( $sql ); if( sqlNumRows( $query ) ) { $array = sqlFetchArray( $query ); } $FinalHTML .= <<
Email $array[first_name] $array[last_name]
$return_message
To:$array[first_name] $array[last_name] <$array[email]>
From:$GLOBALS[SITE_OWNER_NAME] <$GLOBALS[SITE_OWNER_EMAIL]>
Subject:
$no_subject_error
Message:
$no_message_error
Message Type: Plain Text
HTML
Unsubscribe Link: Yes
No
Signoff: Test Mode (send me a test email only)
Real Mailing (I'm sure, do it!)
(Click once and wait)
EOF; echo cleanFinalOutput( $FinalHTML ); ?>