Join David Powers for an in-depth discussion in this video Setting additional headers, part of PHP Email with Swift Mailer.
- View Offline
- [Voiceover] One of the advantages of using Swift Mailer…is that it simplifies the creation of email headers.…Headers are created in three different ways.…As we've seen in this chapter,…some headers such as message ID and date…are created automatically.…Other common headers are created…by invoking methods on the message object.…We've seen many examples…including To, From, Reply To, CC and BCC.…
You can also create custom headers.…But first let's take a look at some…of the useful methods of the message object.…If you're familiar with setting email headers…with the PHP mail function,…you'll know that the content type header…contains two parts,…the message format and the character set.…In Swift Mailer though, they're handled by…separate methods.…setContentType specifies the message format…as plain text or html…while setCharset can be used to change…the character set from the default UTF-8.…
This is useful if you want to change only one value.…We'll be looking at html email in chapter four.…setPriority takes as it's arguement…
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