home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / webmail / nlmail.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  3.1 KB  |  100 lines

  1. <?php
  2.  
  3. /*************************************************************************/
  4.  #  Mailbox 0.9.2a   by Sivaprasad R.L (http://netlogger.net)             #
  5.  #  eMailBox 0.9.3   by Don Grabowski  (http://ecomjunk.com)              #
  6.  #          --  A pop3 client addon for phpnuked websites --              #
  7.  #                                                                        #
  8.  # This program is distributed in the hope that it will be useful,        #
  9.  # but WITHOUT ANY WARRANTY; without even the implied warranty of         #
  10.  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
  11.  # GNU General Public License for more details.                           #
  12.  #                                                                        #
  13.  # You should have received a copy of the GNU General Public License      #
  14.  # along with this program; if not, write to the Free Software            #
  15.  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              #
  16.  #                                                                        #
  17.  #             Copyright (C) by Sivaprasad R.L                            #
  18.  #            Script completed by Ecomjunk.com 2001                       #
  19. /*************************************************************************/
  20.  
  21. if (!eregi("modules.php", $PHP_SELF)) {
  22.     die ("You can't access this file directly...");
  23. }
  24.  
  25. if(!$user) {
  26.     header ("Location: modules.php?name=Your_Account");
  27.     exit();
  28. }
  29.  
  30. require_once("mainfile.php");
  31. $module_name = basename(dirname(__FILE__));
  32. get_lang($module_name);
  33.  
  34. if ($email_send == 1) {
  35.  
  36. include "header.php";
  37. include ("modules/$module_name/mailheader.php");
  38. include ("modules/$module_name/libmail.php");
  39.  
  40. $user = base64_decode($user);
  41. $userdata = explode(":", $user);
  42. $userid = $userdata[0];
  43. srand ((double) microtime() * 1000000);
  44. $messageid = rand();
  45. $result = sql_query("select name, uname, email from ".$user_prefix."_users where uid='$userid'", $dbi);
  46. list($name, $uname, $email) = sql_fetch_row($result, $dbi);
  47.  
  48. /*
  49. $sql = "SELECT * FROM ".$user_prefix."_users WHERE uid='$userid'";
  50. $resultID = sql_query($sql, $dbi);
  51. $myrow = sql_fetch_array($resultID, $dbi);
  52. $email = $myrow[email];
  53. $name = $myrow[name];
  54. $user = $myrow[uname];
  55. */
  56.  
  57. if($name == "") {
  58.     $name = $uname;
  59. }
  60.  
  61. $txtfooter = "\n\n___________________________________________________________________________\n";
  62. $txtfooter .= "$footermsgtxt";
  63. $message = stripslashes($message);
  64. $content = $message.$txtfooter;
  65. $contenttype = "text/plain";
  66. $acknowledge = "N";
  67. $status = "NONE";
  68.  
  69. if($attachment != "") {
  70.     $attachment = $attachmentdir.$attachment;
  71. }
  72.  
  73. $from = "$name <$email>";
  74.  
  75. $m= new Mail;
  76. $m->autoCheck(false);
  77. $m->From($from);
  78. $m->To($to);
  79. $m->Subject($subject);
  80. $m->Body($content);
  81. $m->Cc($cc);
  82. $m->Bcc($bcc);
  83. $m->Priority($prior) ;
  84.  
  85. if($attachment != "")  {
  86.     $m->Attach($attachment,$attchtype);
  87. }
  88.  
  89. $m->Send();
  90. OpenTable();
  91. echo "<center><b>"._MESSAGESENT."</b></center>";
  92. CloseTable();
  93. include ("modules/$module_name/mailfooter.php");
  94.  
  95. } else {
  96.     Header("Location: modules.php?name=$module_name");
  97.     exit();
  98. }
  99.  
  100. ?>