HomePHP Sending Blind Carbon Copies with Swift Mailer
Sending Blind Carbon Copies with Swift Mailer
This fifth part of the series expands your background in the Swift Mailer library. You will learn how to use it for sending blind carbon copies of a basic email message to a predefined recipient. The process is as simple as using its "setBcc()" method.
Undoubtedly, PHP programmers often need to add some kind of email-sending capability to the programs they create, either by using a proprietary library or by way of a third-party package.
While using a custom library (or even a custom framework) may work well when the whole development process of a web-based project is tackled by only one person, this approach won't scale properly if there are many programmers involved in the project.
Naturally, in situations like these it's necessary to look at a third-party email package that not only suits the requirements of a particular web application, but can be used with the same ease and flexibility if the application grows in the future. Fortunately, there are a few well-trusted email libraries available nowadays that will do that job very efficiently, but in my personal opinion, one of the best is Swift Mailer, which you can download freely at http://swiftmailer.org.
To be frank, Swift Mailer will let you build email programs very quickly, through a solid programming interface that strictly implements several design patterns and cleverly applies some key software design principles, used frequently in object-oriented programming.
Logically, if you've already read the previous chapter of this series, you'll be aware of the benefits of using Swift Mailer to add email capacities to a web application. In that tutorial I explained how to send a carbon copy along with an email message via its "setCc()" method. The whole process was a breeze, performed by using only some intuitive, chainable methods.
However, I'm only scratching the surface when it comes to exploring the handy features offered by Swift Mailer. It allows you to attach Bcc MIME headers (short for Blind Carbon Copies) in a snap as well. Thus, in this fifth part of the series I'm going to discuss in depth how to accomplish this through a couple of sample scripts.
Now, it's time to learn how to send out blind carbon copies with Swift Mailer in a few simple steps. Let's get started right away!