This function
opens and closes an SMTP socket for each email, which is not very efficient.
In contrast, when using Zend_Mail_Transport_Smtp, the SMTP connection is maintained by default until
the object stops being used. Therefore it is more suitable than mail() for sending larger volumes of email such
as in the following example:
foreach ($users as $user) { A
$mail->addTo($user->email, $user->full_name);
$mail->setBodyText('Hi ' . $user->first_name . ',
Welcome to our first newsletter.');
$mail->send();
}
In case you??™re wondering why anyone would want to send such an uninteresting newsletter, you??™re
probably ready for the next section where we will begin to use Zend_Mail in an actual application and
make better use of the email body.
9.3 Building a support tracker for Places
The more you work on a project the more you build up lists of bugs, issues, feature ideas. On top of that these
lists end up all over the place; spread across emails, jotted down after phone conversations, frantic notes from a
meeting that are almost illegible. There are existing options available like bug trackers and project
management applications but they are often overkill for clients use and besides that would be too easy! Instead
we are going to build a solution and since the key to good support is communication our support tracker is sure
to be doing a lot of mailing.
Pages:
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254