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

Class: Mail_Queue

Source Location: /Mail_Queue-1.2.3/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 183]

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 ]

_Mail_Queue (Destructor)   [line 257]

void _Mail_Queue( )

Mail_Queue desctructor
  • Access: public

[ Top ]

errorMessage   [line 557]

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 235]

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 273]

void factorySendMail( )

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

[ Top ]

get   [line 472]

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 610]

array getErrors( )

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

[ Top ]

getQueueCount   [line 286]

int getQueueCount( )

Returns the number of emails currently in the queue.

[ Top ]

hasErrors   [line 593]

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 541]

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 497]

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 431]

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

Send mail from MailBody object
  • Return: True on success else pear error class
  • Access: public

Parameters:

bool   $set_as_sent   — 
object MailBody   $mail   —  object

[ Top ]

sendMailById   [line 410]

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

Send Mail by $id identifier. (bypass Mail_Queue)
  • Return: true on success else false
  • Access: public

Parameters:

integer   $id   —  Mail identifier
bool   $set_as_sent   — 

[ Top ]

sendMailsInQueue   [line 341]

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 315]

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:33:50 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.