1946. Class

1946.1. Zend\Mail\Transport\Smtp

SMTP connection object

Loads an instance of ZendMailProtocolSmtp and forwards smtp transactions

1946.1.1. Methods

1946.1.1.1. __construct

__construct()

Constructor.

Parameters:SmtpOptions – Optional

1946.1.1.2. setOptions

setOptions()

Set options

Parameters:SmtpOptions
Return type:Smtp

1946.1.1.3. getOptions

getOptions()

Get options

Return type:SmtpOptions

1946.1.1.4. setPluginManager

setPluginManager()

Set plugin manager for obtaining SMTP protocol connection

Parameters:ProtocolSmtpPluginManager
Throws ExceptionInvalidArgumentException:
 
Return type:Smtp

1946.1.1.5. getPluginManager

getPluginManager()

Get plugin manager for loading SMTP protocol connection

Return type:ProtocolSmtpPluginManager

1946.1.1.6. setAutoDisconnect

setAutoDisconnect()

Set the automatic disconnection when destruct

Parameters:bool
Return type:Smtp

1946.1.1.7. getAutoDisconnect

getAutoDisconnect()

Get the automatic disconnection value

Return type:bool

1946.1.1.8. plugin

plugin()

Return an SMTP connection

Parameters:
  • string
  • array|null
Return type:

ProtocolSmtp

1946.1.1.9. __destruct

__destruct()

Class destructor to ensure all open connections are closed

1946.1.1.10. setConnection

setConnection()

Sets the connection protocol instance

Parameters:ProtocolAbstractProtocol

1946.1.1.11. getConnection

getConnection()

Gets the connection protocol instance

Return type:ProtocolSmtp

1946.1.1.12. disconnect

disconnect()

Disconnect the connection protocol instance

Return type:void

1946.1.1.13. send

send()

Send an email via the SMTP connection protocol

The connection via the protocol adapter is made just-in-time to allow a developer to add a custom adapter if required before mail is sent.

Parameters:Message
Throws ExceptionRuntimeException:
 

1946.1.1.14. prepareFromAddress

prepareFromAddress()

Retrieve email address for envelope FROM

Parameters:Message
Throws ExceptionRuntimeException:
 
Return type:string

1946.1.1.15. prepareRecipients

prepareRecipients()

Prepare array of email address recipients

Parameters:Message
Return type:array

1946.1.1.16. prepareHeaders

prepareHeaders()

Prepare header string from message

Parameters:Message
Return type:string

1946.1.1.17. prepareBody

prepareBody()

Prepare body string from message

Parameters:Message
Return type:string

1946.1.1.18. lazyLoadConnection

lazyLoadConnection()

Lazy load the connection, and pass it helo

Return type:ProtocolSmtp

1946.1.1.19. connect

connect()

Connect the connection, and pass it helo

Return type:ProtocolSmtp