*** empty log message ***
[squirrelmail.git] / plugins / listcommands / mailout.php
CommitLineData
73ee43b1 1<?php
519f07d7 2/**
3 * mailout.php
73ee43b1 4 *
519f07d7 5 * Copyright (c) 1999-2002 The SquirrelMail Project Team
6 * Licensed under the GNU GPL. For full terms see the file COPYING.
7 *
8 * $Id$
73ee43b1 9 */
050722c4 10
73ee43b1 11chdir('..');
12include_once ('../src/validate.php');
13include_once ('../functions/page_header.php');
14include_once ('../src/load_prefs.php');
4cf43843 15include_once('../functions/html.php');
73ee43b1 16
17displayPageHeader($color, $mailbox);
18
4cf43843 19echo html_tag('p', '', 'left' ) .
20html_tag( 'table', '', 'center', $color[0], 'border="0" width="75%"' ) . "\n" .
21 html_tag( 'tr',
22 html_tag( 'th', _("Mailinglist") . ' ' . _($action), '', $color[9] )
23 ) .
24 html_tag( 'tr' ) .
25 html_tag( 'td', '', 'left' );
73ee43b1 26
27switch ( $action ) {
28case 'Help':
519f07d7 29 $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 30 break;
31case 'Subscribe':
519f07d7 32 $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 33 break;
34case 'Unsubscribe':
050722c4 35 $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 36}
37
38printf( $out_string, htmlspecialchars($send_to) );
39
4cf43843 40echo '<form method="post" action="../../src/compose.php">';
73ee43b1 41
42/*
43 * Identity support (RFC 2369 sect. B.1.)
44 *
45 * I had to copy this from compose.php because there doesn't
46 * seem to exist a function to get the identities.
47 */
48
49$defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
50$em = getPref($data_dir, $username, 'email_address');
51if ($em != '') {
52 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
53}
4cf43843 54echo html_tag('p', '', 'center' ) . _("From:") . ' ';
73ee43b1 55
050722c4 56$idents = getPref($data_dir, $username, 'identities');
57if ($idents != '' && $idents > 1) {
4cf43843 58 echo ' <select name="identity">' . "\n" .
59 '<option value="default">' . $defaultmail;
73ee43b1 60 for ($i = 1; $i < $idents; $i ++) {
61 echo '<option value="' . $i . '"';
62 if (isset($identity) && $identity == $i) {
4cf43843 63 echo ' selected';
73ee43b1 64 }
65 echo '>' . htmlspecialchars(getPref($data_dir, $username,
66 'full_name' . $i));
67 $em = getPref($data_dir, $username, 'email_address' . $i);
68 if ($em != '') {
69 echo htmlspecialchars(' <' . $em . '>') . "\n";
70 }
050722c4 71 }
73ee43b1 72 echo '</select>' . "\n" ;
73
050722c4 74} else {
73ee43b1 75 echo $defaultmail;
050722c4 76}
77
4cf43843 78echo '<br>'
050722c4 79. '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
80. '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
81. '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
82. '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
83. '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
84. '</form></TD></TR></TABLE></P></BODY></HTML>';
665ec685 85?>