Nếu ISP của bạn không hỗ trợ xác thực SSL hoặc một số cổng, bạn có thể loại bỏ ssl và cảng chính có giá trị từ $ configInfo. Các giá trị được sử dụng trong các mã có thể được tìm thấy trên trang web của nhà cung cấp dịch vụ e-mail của bạn. | CHAPTER 6 SENDING AND RECEIVING E-MAIL authentication type the type of SSL to use username password and port number to use. If your ISP does not support SSL authentication or a port number you can remove the ssl and port key-value from configInfo. The values used in the code can be found on your e-mail service provider s web site. Once the configuration values are set you can create the Zend_Mail_Transport_Smtp object by passing in the SMTP hostname as the initial value and the configuration information as the second value. Note The e-mail settings can also be set as instance properties of the controller and reused throughout the code. They are defined in the action method for your reference and to demonstrate that they do not necessarily have to be class-level settings. Now for the important question. How do you inform Zend_Mail to use the SMTP information you set Easy Pass in the Zend_Mail_Transport_Smtp object into the send method. Note If you are not using autoload you must include Zend Mail Transport for the example to work. Load the URL http localhost email smtp-send-mail. Once the URL completely loads you will see the e-mail message E-mail sent successfully and will receive an e-mail with the message Hey this is a Zend_Mail-created e-mail. Setting More than One Recipient Cc and Bcc There are projects that require you to send an e-mail to a recipient and a copy of the e-mail to another recipient. The addCc and addBcc methods allow you to do just that. Let s continue building on the previous examples in this chapter by expanding smtpSendMailAction and creating a new action named sendEmailWithCopyAction . Adding a Cc The addCc method allows you to copy anyone by passing in two parameters the e-mail address of the user you want to send a copy of the e-mail to and a string representing the name of the person. Open the file add the sendEmailWithCopyAction action and add the code shown in Listing 6-4. The new action will send an e-mail