PHP: Email with Swift Mailer
3h 9mIntermediate2016-02-22
Authors

David Powers
Developing websites since 1994
Course details
Sending emails programmatically is a common task for developers. Although you can use PHP's native mail() function, it's not very efficient or secure. And there's no easy way to send attachments or HTML email with mail(). If you're looking for an alternative, then Swift Mailer is the tool for you.
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.
Learning objectives
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
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.
Learning objectives
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
Skills covered
PHPProgramming LanguagesOpen SourceSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Welcome
- 02 - What you should know before watching this course
- 03 - Using the exercise files
1. Getting Started
- 04 - What is Swift Mailer
- 05 - Installing Swift Mailer with Composer
- 06 - Installing Swift Mailer from GitHub
- 07 - Loading Swift Mailer
2. Swift Mailer Basics
- 08 - Preparing a basic email
- 09 - Choosing a transport to send the email
- 10 - Sending the email by SMTP
- 11 - Using an encrypted SMTP connection
- 12 - Handing the email to the server's mail transport agent
- 13 - Using Swift Mailer with the PHP mail() function
- 14 - Using an aggregate transport
- 15 - Adding a Reply-To header
- 16 - Copying a message to other reciipients
- 17 - Setting additional headers
3. Sending Attachments
- 18 - Attaching a local file
- 19 - Attaching a dynamically generated file
4. Sending HTML Email
- 20 - HTML email basics
- 21 - Embedding images in HTML email
5. Advanced Features
- 22 - Sending individually addressed emails
- 23 - Personalizing bulk mail
- 24 - Using a custom class to personalize mail
- 25 - Limiting the rate of sending emails
- 26 - Using a logger plugin for debugging
6. Case Study - Registration Form
- 27 - Introducing the case study
- 28 - Checking required fields
- 29 - Building the message body
- 30 - Uploading and attaching a file
- 31 - Sending the email
Conclusion
- 32 - Goodbye