Join David Powers for an in-depth discussion in this video Using an aggregate transport, part of PHP Email with Swift Mailer.
- View Offline
- We've looked at the three single transport classes.…Now let's take a look at using the aggregate transports.…There are two of them,…Swift_LoadBalancedTransport and Swift_FailoverTransport.…They both work exactly the same way.…So I'll show you just how to use one of them.…I've opened aggregate.php in the chapter two,…02_07 folder of the exercise files.…This contains the same code as an encrypted.php,…which we used earlier in this chapter.…
The only difference is that I've changed the subject…line and the body of the message slightly,…so that we can identify the correct email.…Aggregate transports use an array of single transports.…So I need to create at least one more single transport.…So let's see on here at line 12.…Let's just change that.…Create single transport.…And then on the next line I'll create a transport,…which I'm going to call nonexistent.…
And it doesn't matter which type of single transport…that you use, you can have a mixture of them.…But I'm going to use another instance…of Swift_SmtpTransport.…
Swift Mailer is free and feature-rich, and it integrates into any web app written in PHP 5 or 7. Swift Mailer offers a flexible and elegant object-oriented approach to sending emails, including HTML email and bulk email. This PHP tutorial guides developers through the process of installing and loading Swift Mailer, and sending emails using SMTP and encrypted SMTP connections. David Powers teaches secure methods that protect users and support MIME standards. He also introduces advanced techniques for sending attachments, personalizing email, and limiting the send rate. Want to see how Swift Mailer solves a real-world programming challenge? Chapter 6 is a case study that shows how to use Swift Mailer to send an email registration form.
- What is Swift Mailer?
- Installing Swift Mailer
- Preparing basic email
- Sending email via SMTP
- Handing off emails to mail transport agents
- Sending attachments
- Sending HTML email
- Personalizing bulk mail
- Limiting the rate of sending emails