included imap_parse.php
[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');
15
16displayPageHeader($color, $mailbox);
17
050722c4 18echo '<P><TABLE align="center" width="75%" BGCOLOR="' . $color[0] ."\">\n"
19 .'<TR><TH BGCOLOR="'. $color[9] . '">' . _("Mailinglist") . ' ' . _($action) .
20 "</TH></TR>\n<TR><TD>";
21
73ee43b1 22
23switch ( $action ) {
24case 'Help':
519f07d7 25 $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 26 break;
27case 'Subscribe':
519f07d7 28 $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 29 break;
30case 'Unsubscribe':
050722c4 31 $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 32}
33
34printf( $out_string, htmlspecialchars($send_to) );
35
36echo '<form method="POST" action="../../src/compose.php">';
37
38/*
39 * Identity support (RFC 2369 sect. B.1.)
40 *
41 * I had to copy this from compose.php because there doesn't
42 * seem to exist a function to get the identities.
43 */
44
45$defaultmail = htmlspecialchars(getPref($data_dir, $username, 'full_name'));
46$em = getPref($data_dir, $username, 'email_address');
47if ($em != '') {
48 $defaultmail .= htmlspecialchars(' <' . $em . '>') . "\n";
49}
665ec685 50echo '<P><CENTER>' . _("From:") . ' ';
73ee43b1 51
050722c4 52$idents = getPref($data_dir, $username, 'identities');
53if ($idents != '' && $idents > 1) {
73ee43b1 54 echo ' <select name=identity>' . "\n" .
55 '<option value=default>' . $defaultmail;
56 for ($i = 1; $i < $idents; $i ++) {
57 echo '<option value="' . $i . '"';
58 if (isset($identity) && $identity == $i) {
59 echo ' SELECTED';
60 }
61 echo '>' . htmlspecialchars(getPref($data_dir, $username,
62 'full_name' . $i));
63 $em = getPref($data_dir, $username, 'email_address' . $i);
64 if ($em != '') {
65 echo htmlspecialchars(' <' . $em . '>') . "\n";
66 }
050722c4 67 }
73ee43b1 68 echo '</select>' . "\n" ;
69
050722c4 70} else {
73ee43b1 71 echo $defaultmail;
050722c4 72}
73
74echo '<BR>'
75. '<input type=hidden name="send_to" value="' . htmlspecialchars($send_to) . '">'
76. '<input type=hidden name="subject" value="' . htmlspecialchars($subject) . '">'
77. '<input type=hidden name="body" value="' . htmlspecialchars($body) . '">'
78. '<input type=hidden name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
79. '<input type=submit name="send" value="' . _("Send Mail") . '"><BR><BR></CENTER>'
80. '</form></TD></TR></TABLE></P></BODY></HTML>';
665ec685 81?>