Programmer's Reference Guide
Securing SMTP Transport
Zend_Mail also supports the use of either TLS or
SSL to secure a SMTP connection. This can be enabled be passing the
'ssl' parameter to the configuration array in the
Zend_Mail_Transport_Smtp constructor with a value of either 'ssl' or
'tls'. A port can optionally be supplied, otherwise it defaults to 25 for TLS or 465 for
SSL .
Example #1 Enabling a secure connection within Zend_Mail_Transport_Smtp
$config =
array ( 'ssl' =>
'tls' ,
'port' => 25 ) ; // Optional port number supplied
$transport = new Zend_Mail_Transport_Smtp( 'mail.server.com' , $config ) ;
$mail = new Zend_Mail( ) ;
$mail ->setBodyText ( 'This is the text of the mail.' ) ;
$mail ->setFrom ( 'sender@test.com' , 'Some Sender' ) ;
$mail ->addTo ( 'recipient@test.com' , 'Some Recipient' ) ;
$mail ->setSubject ( 'TestSubject' ) ;
$mail ->send ( $transport ) ;
Please enable JavaScript to view the comments powered by Disqus.
blog comments powered by
Select a Version
1.11
1.10
1.9
1.8
1.7
1.6
1.5
1.0
Languages Available
Deutsch English Français 日本語 Русский 简体中文
Components
Select a component
Zend_Acl
Zend_Amf
Zend_Application
Zend_Auth
Zend_Barcode
Zend_Cache
Zend_Captcha
SimpleCloud API: Zend_Cloud
Zend_CodeGenerator
Zend_Config
Zend_Config_Writer
Zend_Console_Getopt
Zend_Controller
Zend_Currency
Zend_Date
Zend_Db
Zend_Debug
Zend_Dojo
Zend_Dom
Zend_Exception
Zend_Feed
Zend_File
Zend_Filter
Zend_Form
Zend_Gdata
Zend_Http
Zend_InfoCard
Zend_Json
Zend_Layout
Zend_Ldap
Zend_Loader
Zend_Locale
Zend_Log
Zend_Mail
Zend_Markup
Zend_Measure
Zend_Memory
Zend_Mime
Zend_Navigation
Zend_Oauth
Zend_OpenId
Zend_Paginator
Zend_Pdf
Zend_ProgressBar
Zend_Queue
Zend_Reflection
Zend_Registry
Zend_Rest
Zend_Search_Lucene
Zend_Serializer
Zend_Server
Zend_Service
Zend_Session
Zend_Soap
Zend_Tag
Zend_Test
Zend_Text
Zend_TimeSync
Zend_Tool
Zend_Tool_Framework
Zend_Tool_Project
Zend_Translate
Zend_Uri
Zend_Validate
Zend_Version
Zend_View
Zend_Wildfire
Zend_XmlRpc
ZendX_Console_Process_Unix
ZendX_JQuery