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

Class: Mail_Queue

Source Location: /Mail_Queue-1.2.7/Mail/Queue.php

Class Overview

PEAR
   |
   --Mail_Queue

Mail_Queue - base class for mail queue managment.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 125]
Mail_Queue - base class for mail queue managment.


[ Top ]


Class Variables

$container =

[line 141]

Mail_Queue_Container

Type:   object


[ Top ]

$mail_options =

[line 134]

Mail options: smtp, mail etc. see Mail::factory

Type:   array


[ Top ]

$send_mail =

[line 148]

Reference to Pear_Mail object

Type:   object


[ Top ]



Method Detail

Mail_Queue (Constructor)   [line 191]

Mail_Queue Mail_Queue( array $container_options, array $mail_options)

Mail_Queue constructor
  • Deprecated:
  • Access: public

Parameters:

array   $container_options   —  Mail_Queue container options
array   $mail_options   —  How send mails.

[ Top ]

__construct (Constructor)   [line 172]

Mail_Queue __construct( $container_options, $mail_options)


Parameters:

   $container_options   — 
   $mail_options   — 

[ Top ]

_Mail_Queue (Destructor)   [line 267]

void _Mail_Queue( )

Mail_Queue desctructor
  • Access: public

[ Top ]

__destruct (Destructor)   [line 275]

void __destruct( )


[ Top ]

errorMessage   [line 606]

string errorMessage( int $value)

Return a textual error message for a MDB error code
  • Return: error message, or false if the error code was not recognized
  • Access: public

Parameters:

int   $value   —  error code

[ Top ]

factory   [line 246]

mixed factory( array $container_options, array $mail_options)

Factory is used to initialize Mail_Queue, this is necessary to catch possible errors during the initialization.
  • Return: Mail_Queue|Mail_Queue_Error
  • See: self::Mail_Queue()
  • Since: 1.2.3

Parameters:

array   $container_options   —  Options for the container.
array   $mail_options   —  Options for mail.

[ Top ]

factorySendMail   [line 291]

void factorySendMail( )

Provides an interface for generating Mail:: objects of various types see Mail::factory()
  • Access: public

[ Top ]

get   [line 521]

object Mail_Queue_Container get( )

Get next mail from queue. The emails are preloaded in a buffer for better performances.
  • Return: or error object
  • Access: public

[ Top ]

getErrors   [line 659]

array getErrors( )

getErrors() returns the errors.
  • See: self::hasErrors()
  • See: self::$_initErrors
  • See: self::Mail_Queue
  • Since: 1.2.3

[ Top ]

getQueueCount   [line 304]

int getQueueCount( )

Returns the number of emails currently in the queue.

[ Top ]

hasErrors   [line 642]

boolean hasErrors( )

hasErrors() returns true/false, if self::$_initErrors are populated.
  • See: self::getErrors()
  • See: self::$_initErrors
  • See: self::Mail_Queue
  • Since: 1.2.3

[ Top ]

isError   [line 590]

boolean isError( int $value)

Tell whether a result code from a Mail_Queue method is an error
  • Return: whether $value is an MAILQUEUE_ERROR
  • Access: public

Parameters:

int   $value   —  result code

[ Top ]

put   [line 546]

mixed put( string $from, string|array $to, string $hdrs, string $body, [ $sec_to_send = 0], [ $delete_after_send = true], [integer $id_user = MAILQUEUE_SYSTEM], string $time_to_send, string $ip)

Put new mail in queue.
  • Return: ID of the record where this mail has been put or Mail_Queue_Error on error
  • See: Mail_Queue_Container::put()
  • Access: public

Parameters:

string   $time_to_send   —  When mail have to be send
integer   $id_user   —  Sender id
string   $ip   —  Sender ip
string   $from   —  Sender e-mail
string|array   $to   —  Reciepient(s) e-mail
string   $hdrs   —  Mail headers (in RFC)
string   $body   —  Mail body (in RFC)
   $sec_to_send   — 
   $delete_after_send   — 

[ Top ]

sendMail   [line 471]

mixed sendMail( object Mail_Queue_Body $mail, [bool $set_as_sent = true])

Send mail from Mail_Queue_Body object
  • Return: True on success else pear error class
  • See: self::sendMailById()
  • Access: public

Parameters:

bool   $set_as_sent   — 
object Mail_Queue_Body   $mail   —  object

[ Top ]

sendMailById   [line 449]

mixed sendMailById( integer $id, [bool $set_as_sent = true])

Send Mail by $id identifier. (bypass Mail_Queue)
  • Return: boolean: true on success else false, or PEAR_Error
  • Access: public
  • Uses: self::sendMail()

Parameters:

integer   $id   —  Mail identifier
bool   $set_as_sent   — 

[ Top ]

sendMailsInQueue   [line 359]

mixed sendMailsInQueue( [integer $limit = MAILQUEUE_ALL], [integer $offset = MAILQUEUE_START], [integer $try = MAILQUEUE_TRY], [mixed $callback = null])

Send mails fom queue.

Mail_Queue::sendMailsInQueue()

  • Return: True on success else MAILQUEUE_ERROR object.

Parameters:

integer   $limit   —  Optional - max limit mails send. This is the max number of emails send by this function.
integer   $offset   —  Optional - you could load mails from $offset (by id)
integer   $try   —  Optional - hoh many times mailqueu should try send each mail. If mail was sent succesful it will be deleted from Mail_Queue.
mixed   $callback   —  Optional, a callback (string or array) to save the SMTP ID and the SMTP greeting.

[ Top ]

setBufferSize   [line 333]

void setBufferSize( [integer $size = 10])

Keep memory usage under control. You can set the max number of mails that can be in the preload buffer at any given time.

It won't limit the number of mails you can send, just the internal buffer size.


Parameters:

integer   $size   —  Optional - internal preload buffer size

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:44:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.