symfony API

sfMailer Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfMailer is the main entry point for the mailer system.

Method Summary

Method Details

  • (Swift_Message) compose ($from, $to, $subject, $body)

    $from The from address
    $to The recipient(s)
    $subject The subject
    $body The body

    Creates a new message.

    returns A Swift_Message instance

  • (int) composeAndSend ($from, $to, $subject, $body)

    $from The from address
    $to The recipient(s)
    $subject The subject
    $body The body

    Sends a message.

    returns The number of sent emails

  • (int) flushQueue ()

    Sends the current messages in the spool.

    The return value is the number of recipients who were accepted for delivery.

    returns The number of sent emails

  • (string) getDeliveryAddress ()

    Gets the delivery address.

    returns The delivery address

  • (string) getDeliveryStrategy ()

    Gets the delivery strategy.

    returns The delivery strategy

  • (sfMailerMessageLoggerPlugin) getLogger ()

    Gets the logger instance.

    returns The logger instance.

  • (Swift_Transport) getRealtimeTransport ()

    Gets the realtime transport instance.

    returns The realtime transport instance.

  • getSpool ()

  • initialize ()

  • (int|false) send ($transport, )

    $transport A transport instance

    Sends the given message.

    returns The number of sent emails

  • (sfMailer) sendNextImmediately ()

    Forces the next call to send() to use the realtime strategy.

    returns The current sfMailer instance

  • setDeliveryAddress ($address)

    $address The delivery address

    Sets the delivery address.

  • setLogger ($logger)

    $logger The logger instance.

    Sets the logger instance.

  • setRealtimeTransport ($transport)

    $transport The realtime transport instance.

    Sets the realtime transport instance.

  • __construct ($dispatcher, $options)

    $dispatcher An event dispatcher instance
    $options An array of options


    Available options:

    * charset: The default charset to use for messages
    * logging: Whether to enable logging or not
    * delivery_strategy: The delivery strategy to use
    * spool_class: The spool class (for the spool strategy)
    * spool_arguments: The arguments to pass to the spool constructor
    * delivery_address: The email address to use for the single_address strategy
    * transport: The main transport configuration
    * * class: The main transport class
    * * param: The main transport parameters