Really skip empty mailto: and bug fix in case of malformed mailto: url
[squirrelmail.git] / plugins / listcommands / mailout.php
CommitLineData
73ee43b1 1<?php
519f07d7 2/**
3 * mailout.php
73ee43b1 4 *
76911253 5 * Copyright (c) 1999-2003 The SquirrelMail Project Team
519f07d7 6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * $Id$
ea5f4b8e 9 * @package plugins
10 * @subpackage listcommands
73ee43b1 11 */
050722c4 12
ea5f4b8e 13/** @ignore */
8d6a115b 14define('SM_PATH','../../');
cdf82d4a 15
16/* SquirrelMail required files. */
17require_once(SM_PATH . 'include/validate.php');
18include_once(SM_PATH . 'functions/page_header.php');
aa7fb30c 19include_once(SM_PATH . 'include/load_prefs.php');
cdf82d4a 20include_once(SM_PATH . 'functions/html.php');
27544ac4 21require_once(SM_PATH . 'functions/identity.php');
73ee43b1 22
23displayPageHeader($color, $mailbox);
24
6a85a764 25/* get globals */
b587ac51 26sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
27sqgetGlobalVar('send_to', $send_to, SQ_GET);
28sqgetGlobalVar('subject', $subject, SQ_GET);
29sqgetGlobalVar('body', $body, SQ_GET);
30sqgetGlobalVar('action', $action, SQ_GET);
6a85a764 31
4cf43843 32echo html_tag('p', '', 'left' ) .
33html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
34 html_tag( 'tr',
35 html_tag( 'th', _("Mailinglist") . ' ' . _($action), '', $color[9] )
36 ) .
37 html_tag( 'tr' ) .
38 html_tag( 'td', '', 'left' );
73ee43b1 39
40switch ( $action ) {
83feb57a 41case 'help':
519f07d7 42 $out_string = _("This will send a message to %s requesting help for this list. You will receive an emailed response at the address below.");
73ee43b1 43 break;
83feb57a 44case 'subscribe':
519f07d7 45 $out_string = _("This will send a message to %s requesting that you will be subscribed to this list. You will be subscribed with the address below.");
73ee43b1 46 break;
83feb57a 47case 'unsubscribe':
050722c4 48 $out_string = _("This will send a message to %s requesting that you will be unsubscribed from this list. It will try to unsubscribe the adress below.");
73ee43b1 49}
50
51printf( $out_string, htmlspecialchars($send_to) );
52
4cf43843 53echo '<form method="post" action="../../src/compose.php">';
73ee43b1 54
73ee43b1 55
27544ac4 56$idents = get_identities();
57
4cf43843 58echo html_tag('p', '', 'center' ) . _("From:") . ' ';
73ee43b1 59
27544ac4 60if (count($idents) > 1) {
61 echo '<select name="identity">';
62 foreach($idents as $nr=>$data) {
63 echo '<option value="' . $nr . '">' .
64 htmlspecialchars(
65 $data['full_name'].' <'.
66 $data['email_address'] . ">\n");
050722c4 67 }
73ee43b1 68 echo '</select>' . "\n" ;
050722c4 69} else {
15ac78fe 70 echo htmlspecialchars('"'.$idents[0]['full_name'].'" <'.$idents[0]['email_address'].'>');
050722c4 71}
72
b1379bdf 73echo '<br />'
74. '<input type="hidden" name="send_to" value="' . htmlspecialchars($send_to) . '">'
75. '<input type="hidden" name="subject" value="' . htmlspecialchars($subject) . '">'
76. '<input type="hidden" name="body" value="' . htmlspecialchars($body) . '">'
77. '<input type="hidden" name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
78. '<input type="submit" name="send" value="' . _("Send Mail") . '"><br /><br /></center>'
79. '</form></td></tr></table></p></body></html>';
665ec685 80?>