PageRenderTime 53ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/test_script/index.php

https://github.com/WimBoelhouwers/PHPMailer
PHP | 556 lines | 508 code | 39 blank | 9 comment | 37 complexity | 39d5af5ea118e47e75a6e0b31f58b03d MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /*
  3. * revised, updated and corrected 27/02/2013
  4. * by matt.sturdy@gmail.com
  5. */
  6. require_once("../class.phpmailer.php");
  7. //This class from http://www.chuggnutt.com/html2text
  8. require_once('../extras/class.html2text.php');
  9. $CFG['smtp_debug'] = 1;
  10. $CFG['smtp_server'] = 'mail.yourserver.com';
  11. $CFG['smtp_port'] = '25';
  12. $CFG['smtp_authenticate'] = 'true';
  13. $CFG['smtp_username'] = 'name@yourserver.com';
  14. $CFG['smtp_password'] = 'yourpassword';
  15. $CFG['smtp_secure'] = 'None';
  16. $from_name = ( isset($_POST['From_Name'])) ? $_POST['From_Name'] : '';
  17. $from_email = ( isset($_POST['From_Email'])) ? $_POST['From_Email'] : '';
  18. $to_name = ( isset($_POST['To_Name'])) ? $_POST['To_Name'] : '';
  19. $to_email = ( isset($_POST['To_Email'])) ? $_POST['To_Email'] : '';
  20. $cc_email = ( isset($_POST['cc_Email'])) ? $_POST['cc_Email'] : '';
  21. $bcc_email = ( isset($_POST['bcc_Email'])) ? $_POST['bcc_Email'] : '';
  22. $subject = ( isset($_POST['Subject'])) ? $_POST['Subject'] : '';
  23. $message = ( isset($_POST['Message'])) ? $_POST['Message'] : '';
  24. $test_type = ( isset($_POST['test_type'])) ? $_POST['test_type'] : '';
  25. $smtp_debug = ( isset($_POST['smtp_debug'])) ? $_POST['smtp_debug'] : $CFG['smtp_debug'];
  26. $smtp_server = ( isset($_POST['smtp_server'])) ? $_POST['smtp_server'] : $CFG['smtp_server'];
  27. $smtp_port = ( isset($_POST['smtp_port'])) ? $_POST['smtp_port'] : $CFG['smtp_port'];
  28. $smtp_secure = strtolower(( isset($_POST['smtp_secure'])) ? $_POST['smtp_secure'] : $CFG['smtp_secure']);
  29. $smtp_authenticate = ( isset($_POST['smtp_authenticate'])) ? $_POST['smtp_authenticate'] : $CFG['smtp_authenticate'];
  30. $authenticate_password = ( isset($_POST['authenticate_password'])) ? $_POST['authenticate_password'] : $CFG['smtp_password'];
  31. $authenticate_username = ( isset($_POST['authenticate_username'])) ? $_POST['authenticate_username'] : $CFG['smtp_username'];
  32. // storing all status output from the script to be shown to the user later
  33. $results_messages = array();
  34. // $example_code represents the "final code" that we're using, and will
  35. // be shown to the user at the end.
  36. $example_code = "\nrequire_once(\"../class.phpmailer.php\");";
  37. $example_code .= "\nrequire_once(\"../extras/class.html2text.php\");";
  38. $example_code .= "\n\n\$results_messages = new array();";
  39. class phpmailerAppException extends Exception {
  40. public function errorMessage() {
  41. $errorMsg = $this->getMessage();
  42. return $errorMsg;
  43. }
  44. }
  45. $example_code .= "\n\nclass phpmailerAppException extends Exception {";
  46. $example_code .= "\n public function errorMessage() {";
  47. $example_code .= "\n \$errorMsg = \$this->getMessage();";
  48. $example_code .= "\n return \$errorMsg;";
  49. $example_code .= "\n }";
  50. $example_code .= "\n}";
  51. if ( isset($_POST["submit"]) && $_POST['submit'] == "Submit" ) {
  52. try {
  53. $to = $_POST['To_Email'];
  54. if(filter_var($to, FILTER_VALIDATE_EMAIL) === FALSE) {
  55. throw new phpmailerAppException("Email address " . $to . " is invalid -- aborting!<br />");
  56. }
  57. }
  58. catch (phpmailerAppException $e) {
  59. $results_messages[] = $e->errorMessage();
  60. }
  61. $example_code .= "\n\ntry {";
  62. $example_code .= "\n \$to = \$_POST[\"To_Email\"];";
  63. $example_code .= "\n if(filter_var(\$to, FILTER_VALIDATE_EMAIL) === FALSE) {";
  64. $example_code .= "\n throw new phpmailerAppException(\"Email address \" . \$to . \" is invalid -- aborting!<br />\");";
  65. $example_code .= "\n }";
  66. $example_code .= "\n}";
  67. $example_code .= "\ncatch (phpmailerAppException \$e) {";
  68. $example_code .= "\n \$results_messages[] = \$e->errorMessage()";
  69. $example_code .= "\n}";
  70. $mail = new PHPMailer();
  71. $example_code .= "\n\n\$mail = new PHPMailer();";
  72. if ( $_POST['test_type'] == "smtp" ) {
  73. $mail->IsSMTP(); // telling the class to use SMTP
  74. $mail->SMTPDebug = $_POST['smtp_debug'];
  75. $mail->Host = $_POST['smtp_server']; // SMTP server
  76. $mail->Port = $_POST['smtp_port']; // set the SMTP port
  77. if ($_POST['smtp_secure']) {
  78. $mail->SMTPSecure = strtolower($_POST['smtp_secure']);
  79. }
  80. $mail->SMTPAuth = $_POST['smtp_authenticate']; // enable SMTP authentication
  81. if ($_POST['smtp_authenticate']) {
  82. $mail->Username = $_POST['authenticate_username']; // SMTP account username
  83. $mail->Password = $_POST['authenticate_password']; // SMTP account password
  84. }
  85. $example_code .= "\n\$mail->IsSMTP();";
  86. $example_code .= "\n\$mail->SMTPDebug = \"".$_POST['smtp_debug']."\";";
  87. $example_code .= "\n\$mail->Host = \"".$_POST['smtp_server']."\";";
  88. $example_code .= "\n\$mail->Port = \"".$_POST['smtp_port']."\";";
  89. $example_code .= "\n\$mail->SMTPSecure = \"".strtolower($_POST['smtp_secure'])."\";";
  90. $example_code .= "\n\$mail->SMTPAuth = \"".$_POST['smtp_authenticate']."\";";
  91. if ($_POST['smtp_authenticate']) {
  92. $example_code .= "\n\$mail->Username = \"".$_POST['authenticate_username']."\";";
  93. $example_code .= "\n\$mail->Password = \"".$_POST['authenticate_password']."\";";
  94. }
  95. }
  96. elseif ( $_POST['test_type'] == "mail" ) {
  97. $mail->IsMail(); // telling the class to use PHP's Mail()
  98. $example_code .= "\n\$mail->IsMail();";
  99. }
  100. elseif ( $_POST['test_type'] == "sendmail" ) {
  101. $mail->IsSendmail(); // telling the class to use Sendmail
  102. $example_code .= "\n\$mail->IsSendmail();";
  103. }
  104. elseif ( $_POST['test_type'] == "qmail" ) {
  105. $mail->IsQmail(); // telling the class to use Qmail
  106. $example_code .= "\n\$mail->IsQmail();";
  107. }
  108. if ( $_POST['From_Name'] != '' ) {
  109. $mail->AddReplyTo($_POST['From_Email'],$_POST['From_Name']);
  110. $mail->From = $_POST['From_Email'];
  111. $mail->FromName = $_POST['From_Name'];
  112. $example_code .= "\n\$mail->AddReplyTo(\"".$_POST['From_Email']."\",\"".$_POST['From_Name']."\");";
  113. $example_code .= "\n\$mail->From = \"".$_POST['From_Email']."\");";
  114. $example_code .= "\n\$mail->FromName = \"".$_POST['From_Name']."\");";
  115. }
  116. else {
  117. $mail->AddReplyTo($_POST['From_Email']);
  118. $mail->From = $_POST['From_Email'];
  119. $mail->FromName = $_POST['From_Email'];
  120. $example_code .= "\n\$mail->AddReplyTo(\"".$_POST['From_Email']."\");";
  121. $example_code .= "\n\$mail->From = \"".$_POST['From_Email']."\";";
  122. $example_code .= "\n\$mail->FromName = \"".$_POST['From_Email']."\";";
  123. }
  124. if ( $_POST['To_Name'] != '' ) {
  125. $mail->AddAddress($to,$_POST['To_Name']);
  126. $example_code .= "\n\$mail->AddAddress(\"$to\",\"".$_POST['To_Name']."\");";
  127. }
  128. else {
  129. $mail->AddAddress($to);
  130. $example_code .= "\n\$mail->AddAddress(\"$to\");";
  131. }
  132. if ( $_POST['bcc_Email'] != '' ) {
  133. $indiBCC = explode(" ", $_POST['bcc_Email']);
  134. foreach ($indiBCC as $key => $value) {
  135. $mail->AddBCC($value);
  136. $example_code .= "\n\$mail->AddBCC(\"$value\");";
  137. }
  138. }
  139. if ( $_POST['cc_Email'] != '' ) {
  140. $indiCC = explode(" ", $_POST['cc_Email']);
  141. foreach ($indiCC as $key => $value) {
  142. $mail->AddCC($value);
  143. $example_code .= "\n\$mail->AddCC(\"$value\");";
  144. }
  145. }
  146. $mail->Subject = $_POST['Subject'] . ' (PHPMailer test using ' . strtoupper($_POST['test_type']) . ')';
  147. $example_code .= "\n\$mail->Subject = \"".$_POST['Subject'].'(PHPMailer test using ' . strtoupper($_POST['test_type']) . ')";';
  148. if ( $_POST['Message'] == '' ) {
  149. $body = file_get_contents('contents.html');
  150. }
  151. else {
  152. $body = $_POST['Message'];
  153. }
  154. $example_code .= "\n\$body = \"".$body.'";';
  155. $mail->WordWrap = 80; // set word wrap
  156. $mail->IsHTML(true); // send as HTML
  157. $mail->Body = $body;
  158. $example_code .= "\n\$mail->WordWrap = 80;";
  159. $example_code .= "\n\$mail->IsHTML(true); // send as HTML";
  160. $example_code .= "\n\$mail->Body = \"$body\";";
  161. // for non-HTML mail clients
  162. $h2t =& new html2text($body);
  163. $mail->AltBody = $h2t->get_text();
  164. $example_code .= "\n\$h2t =& new html2text(\$body);";
  165. $example_code .= "\n\$mail->AltBody = \$h2t->get_text();";
  166. $mail->AddAttachment("images/aikido.gif", "aikido.gif"); // optional name
  167. $mail->AddAttachment("images/phpmailer.gif", "phpmailer.gif"); // optional name
  168. $example_code .= "\n\$mail->AddAttachment(\"images/aikido.gif\", \"aikido.gif\"); // optional name";
  169. $example_code .= "\n\$mail->AddAttachment(\"images/phpmailer.gif\", \"phpmailer.gif\"); // optional name";
  170. try {
  171. if ( !$mail->Send() ) {
  172. $error = "Unable to send to: " . $to . "<br />";
  173. throw new phpmailerAppException($error);
  174. }
  175. else {
  176. $results_messages[] = "Message has been sent using " . strtoupper($_POST["test_type"]);
  177. }
  178. }
  179. catch (phpmailerAppException $e) {
  180. $errorMsg[] = $e->errorMessage();
  181. }
  182. if ( count($errorMsg) > 0 ) {
  183. foreach ($errorMsg as $key => $value) {
  184. $thisError = $key + 1;
  185. $results_messages[] = $thisError . ': ' . $value;
  186. }
  187. }
  188. $example_code .= "\n\ntry {";
  189. $example_code .= "\n if ( !\$mail->Send() ) {";
  190. $example_code .= "\n \$error = \"Unable to send to: \" . \$to . \"<br />\";";
  191. $example_code .= "\n throw new phpmailerAppException(\$error);";
  192. $example_code .= "\n } ";
  193. $example_code .= "\n else {";
  194. $example_code .= "\n \$results_messages[] = \"Message has been sent using \" . strtoupper(\$_POST[\"test_type\"]);";
  195. $example_code .= "\n }";
  196. $example_code .= "\n}";
  197. $example_code .= "\ncatch (phpmailerAppException \$e) {";
  198. $example_code .= "\n \$errorMsg[] = \$e->errorMessage();";
  199. $example_code .= "\n}";
  200. $example_code .= "\n";
  201. $example_code .= "\nif ( count(\$errorMsg) > 0 ) {";
  202. $example_code .= "\n foreach (\$errorMsg as \$key => \$value) {";
  203. $example_code .= "\n \$thisError = \$key + 1;";
  204. $example_code .= "\n \$results_messages[] = \$thisError . \': \' . \$value;";
  205. $example_code .= "\n }";
  206. $example_code .= "\n}";
  207. }
  208. ?><!DOCTYPE html>
  209. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  210. <head>
  211. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  212. <title>PHPMailer Test Page</title>
  213. <script type="text/javascript" src="scripts/shCore.js"></script>
  214. <script type="text/javascript" src="scripts/shBrushPhp.js"></script>
  215. <link type="text/css" rel="stylesheet" href="styles/shCore.css"/>
  216. <link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css"/>
  217. <style>
  218. body {
  219. font-family: Arial, Helvetica, sans-serif;
  220. font-size: 1em;
  221. padding: 1em;
  222. }
  223. table {
  224. margin:0 auto;
  225. border-spacing: 0;
  226. border-collapse: collapse;
  227. }
  228. table.column {
  229. border-collapse: collapse;
  230. background-color: #FFFFFF;
  231. padding: 0.5em;
  232. width: 35em;
  233. }
  234. td {
  235. font-size: 1em;
  236. padding: 0.1em 0.25em;
  237. -moz-border-radius: 1em;
  238. -webkit-border-radius: 1em;
  239. border-radius: 1em;
  240. }
  241. td.colleft {
  242. text-align: right;
  243. width: 35%;
  244. }
  245. td.colrite {
  246. text-align: left;
  247. width: 65%;
  248. }
  249. fieldset {
  250. padding: 1em 1em 1em 1em;
  251. margin: 0 2em ;
  252. border-radius: 1.5em;
  253. -webkit-border-radius: 1em;
  254. -moz-border-radius: 1em;
  255. }
  256. fieldset.inner {
  257. width:40%;
  258. }
  259. fieldset:hover, tr:hover {
  260. background-color: #fafafa;
  261. }
  262. legend {
  263. font-weight: bold;
  264. font-size: 1.1em;
  265. }
  266. div.column-left {
  267. float:left;
  268. width:45em;
  269. height:31em;
  270. }
  271. div.column-right {
  272. display:inline;
  273. width:45em;
  274. max-height:31em;
  275. }
  276. input.radio {
  277. float:left;
  278. }
  279. div.radio {
  280. padding: 0.2em;
  281. }
  282. </style>
  283. <script>
  284. SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
  285. SyntaxHighlighter.all();
  286. function startAgain() {
  287. var post_params = {
  288. "From_Name" : "<?php echo $from_name; ?>",
  289. "From_Email": "<?php echo $from_email; ?>",
  290. "To_Name" : "<?php echo $to_name; ?>",
  291. "To_Email" : "<?php echo $to_email; ?>",
  292. "cc_Email" : "<?php echo $cc_email; ?>",
  293. "bcc_Email" : "<?php echo $bcc_email; ?>",
  294. "Subject" : "<?php echo $subject; ?>",
  295. "Message" : "<?php echo $message; ?>",
  296. "test_type" : "<?php echo $test_type; ?>",
  297. "smtp_debug": "<?php echo $smtp_debug; ?>",
  298. "smtp_server": "<?php echo $smtp_server; ?>",
  299. "smtp_port" : "<?php echo $smtp_port; ?>",
  300. "smtp_secure": "<?php echo $smtp_secure; ?>",
  301. "smtp_authenticate": "<?php echo $smtp_authenticate; ?>",
  302. "authenticate_username": "<?php echo $authenticate_username; ?>",
  303. "authenticate_password": "<?php echo $authenticate_password; ?>"
  304. };
  305. var resetForm = document.createElement("form");
  306. resetForm.setAttribute("method", "POST");
  307. resetForm.setAttribute("path", "index.php");
  308. for(var k in post_params) {
  309. var h = document.createElement("input");
  310. h.setAttribute("type", "hidden");
  311. h.setAttribute("name", k);
  312. h.setAttribute("value", post_params[k]);
  313. resetForm.appendChild(h);
  314. }
  315. document.body.appendChild(resetForm);
  316. resetForm.submit();
  317. }
  318. function showHideDiv(test, element_id) {
  319. var ops = {"smtp-options-table" : "smtp"}
  320. if (test == ops[element_id]) {
  321. document.getElementById(element_id).style.display="block";
  322. } else {
  323. document.getElementById(element_id).style.display="none";
  324. }
  325. }
  326. </script>
  327. </head>
  328. <body>
  329. <?php
  330. if ( substr(phpversion(),0,1) < 5 ) {
  331. echo 'Current PHP version: ' . phpversion() . "<br />";
  332. echo exit("ERROR: Wrong PHP version. Must be PHP 5 or above.");
  333. }
  334. if (count($results_messages) > 0) {
  335. foreach ($results_messages as $result) {
  336. echo "<div>$result</div>";
  337. }
  338. }
  339. if (isset($_POST["submit"]) && $_POST["submit"] == "Submit") {
  340. echo "<button type=\"submit\" onclick=\"startAgain();\">Start Over</button><br/>\n";
  341. echo "<br/><span>Script:</span>\n";
  342. echo "<pre class=\"brush: php;\">\n";
  343. echo $example_code;
  344. echo "\n</pre>\n";
  345. echo "\n<hr style=\"margin: 3em;\">\n";
  346. }
  347. ?>
  348. <form method="POST" enctype="multipart/form-data">
  349. <div>
  350. <div class="column-left">
  351. <fieldset>
  352. <legend>Mail Details</legend>
  353. <table border="1" class="column">
  354. <tr>
  355. <td class="colleft">
  356. <label for="From_Name"><strong>From</strong> Name</label>
  357. </td>
  358. <td class="colrite">
  359. <input type="text" id="From_Name" name="From_Name" value="<?php echo $from_name; ?>" style="width:95%;" autofocus placeholder="Your Name">
  360. </td>
  361. </tr>
  362. <tr>
  363. <td class="colleft">
  364. <label for="From_Email"><strong>From</strong> Email Address</label>
  365. </td>
  366. <td class="colrite">
  367. <input type="text" id="From_Email" name="From_Email" value="<?php echo $from_email; ?>" style="width:95%;" required placeholder="Your.Email@domain.com">
  368. </td>
  369. </tr>
  370. <tr>
  371. <td class="colleft">
  372. <label for="To_Name"><strong>To</strong> Name</label>
  373. </td>
  374. <td class="colrite">
  375. <input type="text" id="To_Name" name="To_Name" value="<?php echo $to_name; ?>" style="width:95%;" placeholder="Recipient's Name">
  376. </td>
  377. </tr>
  378. <tr>
  379. <td class="colleft">
  380. <label for="To_Email"><strong>To</strong> Email Address</label>
  381. </td>
  382. <td class="colrite">
  383. <input type="text" id="To_Email" name="To_Email" value="<?php echo $to_email; ?>" style="width:95%;" required placeholder="Recipients.Email@domain.com">
  384. </td>
  385. </tr>
  386. <tr>
  387. <td class="colleft">
  388. <label for="cc_Email"><strong>CC Recipients</strong><br/><small>(separate with commas)</small></label>
  389. </td>
  390. <td class="colrite">
  391. <input type="text" id="cc_Email" name="cc_Email" value="<?php echo $cc_email; ?>" style="width:95%;" placeholder="cc1@domain.com, cc2@domain.com">
  392. </td>
  393. </tr>
  394. <tr>
  395. <td class="colleft">
  396. <label for="bcc_Email"><strong>BCC Recipients</strong><br/><small>(separate with commas)</small></label>
  397. </td>
  398. <td class="colrite">
  399. <input type="text" id="bcc_Email" name="bcc_Email" value="<?php echo $bcc_email; ?>" style="width:95%;" placeholder="bcc1@domain.com, bcc2@domain.com">
  400. </td>
  401. </tr>
  402. <tr>
  403. <td class="colleft">
  404. <label for="Subject"><strong>Subject</strong></label>
  405. </td>
  406. <td class="colrite">
  407. <input type="text" name="Subject" id="Subject" value="<?php echo $subject; ?>" style="width:95%;" placeholder="Email Subject">
  408. </td>
  409. </tr>
  410. <tr>
  411. <td class="colleft">
  412. <label for="Message"><strong>Message</strong><br /><small>If blank, will use content.html</small></label>
  413. </td>
  414. <td class="colrite">
  415. <textarea name="Message" id="Message" style="width:95%;height:5em;" placeholder="Body of your email"><?php echo $message; ?></textarea>
  416. </td>
  417. </tr>
  418. </table>
  419. <div style="margin:1em 0;">Test will include two attachments.</div>
  420. </fieldset>
  421. </div>
  422. <div class="column-right">
  423. <fieldset class="inner"> <!-- SELECT TYPE OF MAIL -->
  424. <legend>Mail Test Specs</legend>
  425. <table border="1" class="column">
  426. <tr>
  427. <td class="colleft">Test Type</td>
  428. <td class="colrite">
  429. <div class="radio">
  430. <label for="radio-mail">Mail()</label>
  431. <input class="radio" type="radio" name="test_type" value="mail" id="radio-mail" onclick="showHideDiv(this.value, 'smtp-options-table');" <?php echo ( $test_type == 'mail') ? 'checked' : ''; ?> required>
  432. </div>
  433. <div class="radio">
  434. <label for="radio-sendmail">Sendmail</label>
  435. <input class="radio" type="radio" name="test_type" value="sendmail" id="radio-sendmail" onclick="showHideDiv(this.value, 'smtp-options-table');" <?php echo ( $test_type == 'sendmail') ? 'checked' : ''; ?> required>
  436. </div>
  437. <div class="radio">
  438. <label for="radio-qmail">Qmail</label>
  439. <input class="radio" type="radio" name="test_type" value="qmail" id="radio-qmail" onclick="showHideDiv(this.value, 'smtp-options-table');" <?php echo ( $test_type == 'qmail') ? 'checked' : ''; ?> required>
  440. </div>
  441. <div class="radio">
  442. <label for="radio-smtp">SMTP</label>
  443. <input class="radio" type="radio" name="test_type" value="smtp" id="radio-smtp" onclick="showHideDiv(this.value, 'smtp-options-table');" <?php echo ( $test_type == 'smtp') ? 'checked' : ''; ?> required>
  444. </div>
  445. </td>
  446. </tr>
  447. </table>
  448. <div id="smtp-options-table" style="margin:1em 0 0 0; <?php if($test_type != 'smtp') {echo "display: none;";}?>">
  449. <span style="margin:1.25em 0; display:block;"><strong>SMTP Specific Options:</strong></span>
  450. <table border="1" class="column">
  451. <tr>
  452. <td class="colleft"><label for="smtp_debug">SMTP Debug ?</label></td>
  453. <td class="colrite">
  454. <select size="1" id="smtp_debug" name="smtp_debug">
  455. <option <?php echo ( $smtp_debug == '0') ? 'selected' : ''; ?> value="0">0 - Disabled</option>
  456. <option <?php echo ( $smtp_debug == '1') ? 'selected' : ''; ?> value="1">1 - Errors and Messages</option>
  457. <option <?php echo ( $smtp_debug == '2') ? 'selected' : ''; ?> value="2">2 - Messages only</option>
  458. </select>
  459. </td>
  460. </tr>
  461. <tr>
  462. <td class="colleft"><label for="smtp_server">SMTP Server</label></td>
  463. <td class="colrite">
  464. <input type="text" id="smtp_server" name="smtp_server" value="<?php echo $smtp_server; ?>" style="width:95%;" placeholder="smtp.server.com">
  465. </td>
  466. </tr>
  467. <tr>
  468. <td class="colleft" style="width: 5em;"><label for="smtp_port">SMTP Port</label></td>
  469. <td class="colrite">
  470. <input type="text" name="smtp_port" id="smtp_port" size="3" value="<?php echo $smtp_port; ?>" placeholder="Port">
  471. </td>
  472. </tr>
  473. <tr>
  474. <td class="colleft" ><label for="smtp_secure">SMTP Security</label></td>
  475. <td>
  476. <select size="1" name="smtp_secure" id="smtp_secure">
  477. <option <?php echo ( $smtp_secure == 'none') ? 'selected' : ''?>>None</option>
  478. <option <?php echo ( $smtp_secure == 'tls') ? 'selected' : ''?>>TLS</option>
  479. <option <?php echo ( $smtp_secure == 'ssl') ? 'selected' : ''?>>SSL</option>
  480. </select>
  481. </td>
  482. </tr>
  483. <tr>
  484. <td class="colleft"><label for="smtp-authenticate">SMTP Authenticate?</label></td>
  485. <td class="colrite">
  486. <input type="checkbox" id="smtp-authenticate" name="smtp_authenticate" <?php if ($smtp_authenticate!=''){ echo "checked";} ?> value="<?php echo $smtp_authenticate; ?>">
  487. </td>
  488. </tr>
  489. <tr>
  490. <td class="colleft"><label for="authenticate_username">Authenticate Username</label></td>
  491. <td class="colrite">
  492. <input type="text" id="authenticate_username" name="authenticate_username" value="<?php echo $authenticate_username; ?>" style="width:95%;" placeholder="SMTP Server Username">
  493. </td>
  494. </tr>
  495. <tr>
  496. <td class="colleft"><label for="authenticate_password">Authenticate Password</label></td>
  497. <td class="colrite">
  498. <input type="password" name="authenticate_password" id="authenticate_password" value="<?php echo $authenticate_password; ?>" style="width:95%;" placeholder="SMTP Server Password">
  499. </td>
  500. </tr>
  501. </table>
  502. </div>
  503. </fieldset>
  504. </div>
  505. <br style="clear:both;">
  506. <div style="margin-left:2em; margin-bottom:5em; float:left;">
  507. <div style="margin-bottom: 1em; ">
  508. <input type="submit" value="Submit" name="submit">
  509. </div>
  510. <?php echo 'Current PHP version: ' . phpversion(); ?>
  511. </div>
  512. </div>
  513. </form>
  514. </body>
  515. </html>