mailout.php 2.5 KB

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