home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / add_example.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  1.1 KB  |  41 lines

  1. <?php
  2.  
  3. require_once ( "base.php" );
  4. $mail_queue =& new Mail_Queue($db_options, $mail_options);
  5.  
  6. $from = 'user@server.com';
  7. $from_name = "Chief";
  8.  
  9. $recipient = "user2@server.com";
  10. $recipient_name = "admin";
  11. $message = 'Hi! This is test message!! :)';
  12. $from_params = empty($from_name) ? '"'.$from_name.'" <'.$from.'>' : '<'.$from.'>';
  13. $recipient_params = empty($recipient_name) ? '"'.$recipient_name.'" <'.$recipient.'>' : '<'.$recipient.'>';
  14. $hdrs = array( 'From'    => $from_params,
  15.                'To'      => $recipient_params,
  16.                'Subject' => "test message body"  );
  17.  
  18. $mime =& new Mail_mime();
  19. $mime->setTXTBody($message);
  20. $body = $mime->get();
  21. $hdrs = $mime->headers($hdrs);
  22.  
  23.  
  24. /* Put message to queue */
  25. $mail_queue->put( $from, $recipient, $hdrs, $body );
  26.  
  27.  
  28. /* Also you could put this msg in more advanced mode */
  29.  
  30. // how many seconds wait to send mail
  31. $seconds_to_send = 3600;
  32.  
  33. // delete mail from db after send?
  34. $delete_after_send = false;
  35.  
  36. // if you backup some mails in db you could group them later by the user identifier, for example
  37. $id_user = 7;
  38.  
  39. $mail_queue->put( $from, $recipient, $hdrs, $body, $seconds_to_send, $delete_after_send, $id_user );
  40.  
  41. ?>