Join David Powers for an in-depth discussion in this video Adding a Reply-To header, part of PHP Email with Swift Mailer.
- View Offline
- [Voiceover] When processing an online form,…it's common practice to insert the value…from an email field into the From or Reply-To header.…It's convenient to do so because it allows…you to reply directly to the person who submitted the form.…The downside is that unless it's done correctly,…it exposes you to the danger of…email header injection attacks.…Let's see how we can eliminate that danger…with Swift Mailer.…I've opened reply_to.php, which you can find…in the Chapter Two 02_08 folder…of the exercise files, and we'll use this…to test Reply-To, and the body of the message…will be Click the Reply button in your email program.…
A common mistake is to use the From header…for the email address submitted by an online form.…The From header should always indicate…where the email originated, and that's your…web server, not some arbitrary address…gathered from an online form.…So, on line eight, I'm using the From variable…for the From header that's stored in config.php.…That's my normal email address that I'm sending from.…
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