/home/desid573/svoldvine.com.au/mailer/PHPMailer_5.2.0/test_script
NameSizeModeActions
images/-0755rm
scripts/-0755rm
src/-0755rm
styles/-0755rm
contents.html5140644editdlrm
index.php179530644editdlrm
LGPLv3.txt76380644editdlrm
test.html21220644editdlrm
Edit: /home/desid573/svoldvine.com.au/mailer/PHPMailer_5.2.0/test_script/index.php (17953B)
PHPMailer Test Page "; if ( substr(phpversion(),0,1) < 5 ) { echo exit("ERROR: Wrong PHP version"); } $CFG['smtp_debug'] = 1; $CFG['smtp_server'] = 'mail.yourserver.com'; $CFG['smtp_port'] = '25'; $CFG['smtp_authenticate'] = 'true'; $CFG['smtp_username'] = 'name@yourserver.com'; $CFG['smtp_password'] = 'yourpassword'; if ( $_POST['submit'] == "Submit" ) { class phpmailerAppException extends Exception { public function errorMessage() { $errorMsg = '' . $this->getMessage() . "
"; return $errorMsg; } } try { $to = $_POST['To_Email']; if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) { throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!
"); } } catch (phpmailerAppException $e) { echo $e->errorMessage(); return false; } require_once("../class.phpmailer.php"); $mail = new PHPMailer(); if ( $_POST['Message'] == '' ) { $body = $mail->getFile('contents.html'); $body = eregi_replace("[\]",'',$body); } else { $body = $_POST['Message']; } if ( $_POST['test_type'] == "smtp" ) { $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = $_POST['smtp_debug']; $mail->SMTPAuth = $_POST['smtp_authenticate']; // enable SMTP authentication $mail->Port = $_POST['smtp_port']; // set the SMTP port $mail->Host = $_POST['smtp_server']; // SMTP server $mail->Username = $_POST['authenticate_username']; // SMTP account username $mail->Password = $_POST['authenticate_password']; // SMTP account password } elseif ( $_POST['test_type'] == "mail" ) { $mail->IsMail(); // telling the class to use PHP's Mail() } elseif ( $_POST['test_type'] == "sendmail" ) { $mail->IsSendmail(); // telling the class to use Sendmail } elseif ( $_POST['test_type'] == "qmail" ) { $mail->IsQmail(); // telling the class to use Qmail } if ( $_POST['From_Name'] != '' ) { $mail->AddReplyTo($_POST['From_Email'],$_POST['From_Name']); $mail->From = $_POST['From_Email']; $mail->FromName = $_POST['From_Name']; } else { $mail->AddReplyTo($_POST['From_Email']); $mail->From = $_POST['From_Email']; $mail->FromName = $_POST['From_Email']; } if ( $_POST['To_Name'] != '' ) { $mail->AddAddress($to,$_POST['To_Name']); } else { $mail->AddAddress($to); } if ( $_POST['bcc_Email'] != '' ) { $indiBCC = explode(" ", $_POST['bcc_Email']); foreach ($indiBCC as $key => $value) { $mail->AddBCC($value); } } if ( $_POST['cc_Email'] != '' ) { $indiCC = explode(" ", $_POST['cc_Email']); foreach ($indiCC as $key => $value) { $mail->AddCC($value); } } $mail->Subject = $_POST['Subject'] . ' (PHPMailer test using ' . strtoupper($_POST['test_type']) . ')'; require_once('../class.html2text.inc.php'); $h2t =& new html2text($body); $mail->AltBody = $h2t->get_text(); //$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->WordWrap = 80; // set word wrap $mail->MsgHTML($body); // $mail->IsHTML(true); // send as HTML $mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name $mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name try { if ( !$mail->Send() ) { $error = "Unable to send to: " . $to . "
"; throw new phpmailerAppException($error); } else { echo 'Message has been sent using ' . strtoupper($_POST['test_type']) . "

"; } } catch (phpmailerAppException $e) { $errorMsg[] = $e->errorMessage(); } if ( count($errorMsg) > 0 ) { foreach ($errorMsg as $key => $value) { $thisError = $key + 1; echo $thisError . ': ' . $value; } } ?>


Script:
class phpmailerAppException extends Exception {
  public function errorMessage() {
    $errorMsg = '' . $this->getMessage() . "
"; return $errorMsg; } } try { $to = ; if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) { throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!
"); } } catch (phpmailerAppException $e) { echo $e->errorMessage(); return false; } require_once("../class.phpmailer.php"); $mail = new PHPMailer(); getFile(\'contents.html\');' . "\n"; echo '$body = eregi_replace("[\]",\'\',$body);' . "\n"; } else { echo '$body = ' . $_POST['Message'] . "\n"; } echo "\n"; if ( $_POST['test_type'] == "smtp" ) { echo '$mail->IsSMTP(); // telling the class to use SMTP' . "\n"; echo '$mail->SMTPDebug = ' . $_POST['smtp_debug'] . "\n"; echo '$mail->SMTPAuth = ' . $_POST['smtp_authenticate']; // enable SMTP authentication' . "\n"; echo '$mail->Port = ' . $_POST['smtp_port']; // set the SMTP port' . "\n"; echo '$mail->Host = ' . $_POST['smtp_server']; // SMTP server' . "\n"; echo '$mail->Username = ' . $_POST['authenticate_username']; // SMTP account username' . "\n"; echo '$mail->Password = ' . $_POST['authenticate_password']; // SMTP account password' . "\n"; } elseif ( $_POST['test_type'] == "mail" ) { echo '$mail->IsMail(); // telling the class to use PHP\'s Mail()' . "\n"; } elseif ( $_POST['test_type'] == "sendmail" ) { echo '$mail->IsSendmail(); // telling the class to use Sendmail' . "\n"; } elseif ( $_POST['test_type'] == "qmail" ) { echo '$mail->IsQmail(); // telling the class to use Qmail' . "\n"; } ?> $mail->AddReplyTo('',''); $mail->From = ''; $mail->FromName = ''; $mail->AddAddress('',''); $mail->AddAddress(''); $value) { echo '$mail->AddBCC(\'' . $value . '\');
'; } } if ( $_POST['cc_Email'] != '' ) { $indiCC = explode(" ", $_POST['cc_Email']); foreach ($indiCC as $key => $value) { echo '$mail->AddCC(\'' . $value . '\');
'; } } ?> $mail->Subject = (PHPMailer test using ) require_once('../class.html2text.inc.php'); $h2t =& new html2text($body); $mail->AltBody = $h2t->get_text(); $mail->WordWrap = 80; // set word wrap $mail->MsgHTML($body); $mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name $mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name try { if ( !$mail->Send() ) { $error = "Unable to send to: " . $to . "
"; throw new phpmailerAppException($error); } else { echo 'Message has been sent using

'; } } catch (phpmailerAppException $e) { $errorMsg[] = $e->errorMessage(); } if ( count($errorMsg) > 0 ) { foreach ($errorMsg as $key => $value) { $thisError = $key + 1; echo $thisError . ': ' . $value; } }
Message

From Name
From Email Address
To Name
To Email Address
cc Email Addresses (separate with commas)
bcc Email Addresses (separate with commas)
Subject
Message
If blank, will use content.html
Mail Test Specs

Test Type
> Mail()
> Sendmail
> Qmail
> SMTP
If SMTP test:
SMTP Debug ?
SMTP Server
SMTP Port
SMTP Authenticate ? value="">
Authenticate Username
Authenticate Password

Test will include two attachments, plus one of the attachments is used as an inline graphic in the message body.