public function runtest() { ## for this test to work, we should not use the developer_email unset($GLOBALS['developer_email']); print '<br/>Should be successful: '; ## this one should succeed $ok = sendMailDirect('*****@*****.**', 'Test', 'Test sending'); if ($ok) { print $GLOBALS['img_tick']; } else { print $GLOBALS['img_cross']; } ## and this one fail print '<br/>Should fail: '; $fail = sendMailDirect('*****@*****.**', 'Test', 'Test sending'); if (!$fail) { print $GLOBALS['smtpError']; print $GLOBALS['img_tick']; } else { print $GLOBALS['img_cross']; } return $ok && !$fail; }
$user_att = getUserAttributeValues($email); if (sizeof($user_att)) { while (list($att_name, $att_value) = each($user_att)) { $thankyoupage = str_ireplace("[" . $att_name . "]", $att_value, $thankyoupage); } } if (is_array($GLOBALS["plugins"])) { reset($GLOBALS["plugins"]); foreach ($GLOBALS["plugins"] as $name => $plugin) { $thankyoupage = $plugin->parseThankyou($id, $userid, $thankyoupage); } } if ($sendrequest && $listsok) { #is_array($_POST["list"])) { if (RFC_DIRECT_DELIVERY) { $ok = sendMailDirect($email, getConfig("subscribesubject:{$id}"), $subscribemessage, system_messageheaders($email), $envelope, 1); if (!$ok) { print '<h3>' . $strEmailFailed . '</h3>'; print '<p>' . $GLOBALS['smtpError'] . '</p>'; } else { sendAdminCopy("Lists subscription", "\n" . $email . " has subscribed\n\n{$history_entry}", $subscriptions); addUserHistory($email, $history_subject, $history_entry); print $thankyoupage; } } elseif (sendMail($email, getConfig("subscribesubject:{$id}"), $subscribemessage, system_messageheaders($email), $envelope, 1)) { sendAdminCopy("Lists subscription", "\n" . $email . " has subscribed\n\n{$history_entry}", $subscriptions); addUserHistory($email, $history_subject, $history_entry); print $thankyoupage; } else { print '<h3>' . $strEmailFailed . '</h3>'; if ($blacklisted) {