| | |
| | | ?> |
| | | <table border="0"> |
| | | <tr> |
| | | <th> |
| | | <h4>SMTP Settings</h4> |
| | | </th> |
| | | <th> |
| | | <h4>IMAP Settings</h4> |
| | | </th> |
| | | <th><h4>SMTP Settings</h4></th> |
| | | <th><h4>IMAP Settings</h4></th> |
| | | </tr> |
| | | <tr> |
| | | <td valign="top"><?php |
| | |
| | | echo 'pass: <i>not set</i><br/>'; |
| | | } |
| | | ?></td> |
| | | <td valign="top"><?php |
| | | <td valign="top"> |
| | | <?php |
| | | echo 'IMAP: ' . CHECK_OK . '<br />'; |
| | | if (isset($rctest_config['default_host']) && is_array($rctest_config['default_host'])) { |
| | | echo 'server: '.var_export($rctest_config['default_host'], true).'<br/>'; |
| | |
| | | ?> Recipient:<br /> |
| | | <?php echo $rctest_config['from']; ?><br /> |
| | | <br /> |
| | | <input type="hidden" name="action" value="smtp" /> <input type="submit" |
| | | value="send an email" /></form> |
| | | <input type="hidden" name="action" value="smtp" /> |
| | | <input type="submit" value="send an email" /> |
| | | </form> |
| | | <?php |
| | | if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['action'] == 'smtp') { |
| | | |
| | |
| | | echo CHECK_NOK . '<br />'; |
| | | echo '<i>Please edit $rctest_config in ' . basename(__FILE__) . '</i><br />'; |
| | | } else { |
| | | |
| | | $data = $_POST['smtp_test']; |
| | | $data = null; |
| | | $CONFIG = $rctest_config; |
| | | if (isset($_POST['smtp_test'])) { |
| | | $data = $_POST['smtp_test']; |
| | | |
| | | // inject into config array |
| | | $CONFIG['smtp_user'] = $data['user']; |
| | | $CONFIG['smtp_pass'] = $data['pass']; |
| | | } |
| | | |
| | | require_once 'lib/rc_mail_mime.inc'; |
| | | require_once 'include/rcube_smtp.inc'; |
| | |
| | | $body = 'This is a test to confirm that RoundCube can send email.'; |
| | | |
| | | $mail_object = new rc_mail_mime(); |
| | | $mail_object->headers($headers); |
| | | $send_headers = $mail_object->headers($headers); |
| | | |
| | | $smtp_response = array(); |
| | | if (smtp_mail($rctest_config['from'], $recipients, ($foo = $mail_object->txtHeaders($send_headers)), $body, $smtp_response)) { |
| | | |
| | | $status = smtp_mail($rctest_config['from'], $recipients, |
| | | ($foo = $mail_object->txtHeaders($send_headers)), |
| | | $body, $smtp_response); |
| | | |
| | | if ($status) { |
| | | echo CHECK_OK . '<br />'; |
| | | } else { |
| | | echo CHECK_NOK; |