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