Mail_Queue
[ class tree: Mail_Queue ] [ index: Mail_Queue ] [ all elements ]

Source for file add_example.php

Documentation is available at add_example.php

  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. ?>

Documentation generated on Mon, 11 Mar 2019 13:54:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.