Join David Powers for an in-depth discussion in this video What you should know before watching this course, part of PHP: Email with Swift Mailer.
- Let's begin by reviewing what you need to follow this course. This is not a course for beginners. I expect you to be familiar with basic PHP syntax and functions. You should also be comfortable using PHP classes and objects. Although we won't be using the PHP mail() function, you should know how it works. Otherwise, some of the explanations won't make much sense to you. And for the case study in Chapter Six, you'll need a good understanding of HTML and how online forms work.
If you've been working with PHP and web development for a few months, you should be fine. The other requirements for the course include a PHP testing server running PHP 5.4 or later. Swift Mailer is backwards compatible as far as PHP 5.3, but I use the shorthand array syntax that was first introduced in 5.4. I recorded this course using PHP 7, but I don't use any features that are exclusive to PHP 7.
Ideally you'll also need access to an SMTP mail server because this is the recommended way to use Swift Mailer. SMTP stands for Simple Message Transport Protocol. It's the main standard for email delivery. If you've got an email account with an Internet Service Provider or if your website includes email accounts, you should be able to use that mail server. But a Webmail service, such as Gmail, is not suitable. If you don't have access to an SMTP server, it's still possible to use Swift Mailer, as explained in Chapter Two.
However, you'll need to change the code in most of the exercise files to do so. Moreover, the alternative methods will work only on Mac OS X or Linux. For local testing on Windows, access to an SMTP server is essential. Finally, you'll need Swift Mailer. It's free and Open Source. Chapter One explains how to obtain and install it. The version used in this course is 5.4.1 which was the current stable version at the time of recording.
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