Home arrow PHP arrow Using Different Paths for Attachments with Swift Mailer

Using Different Paths for Attachments with Swift Mailer

Welcome to the seventh tutorial of a series on Swift Mailer. Comprised of ten parts, this series introduces you gently to using this thorough PHP5-based email package. It complements the corresponding theory with numerous code samples that you can incorporate into your own PHP applications.

TABLE OF CONTENTS:
  1. Using Different Paths for Attachments with Swift Mailer
  2. Review: handling file attachments with Swift Mailer
  3. Attaching files from a different location with the fromPath() method
  4. Attaching files from a remote host
By: Alejandro Gervasio
Rating: starstarstarstarstar / 1
February 23, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

If you’re a PHP developer who’s looking for an approachable guide that teaches you how to take advantage of the most relevant features provided by the powerful Swift Mailer email library (available at http://swiftmailer.org), then this group of tutorials might be the material that you really need.  

Now that you’re aware of the goal of this article series, it’s time to review the topics that were discussed in the last tutorial. In that part of the series I explained how to attach one single file to a simple email message, and how to sent the message in HTML format.

In the first case, the sample file was attached by using a separate class included with Swift Mailer, called “Swift_Attachment,” while the formatting of the message with HTML was done via the “addPart()” method that belongs to the already familiar “Swift_Message" class.

However, the Swift Mailer library has plenty of options for handling files, including the ability to attach them from different locations on the web server and even from remote hosts. So, this seventh installment of the series will be focused on illustrating how to attach a file to an email message from a distinct folder, thus demonstrating the flexibility of the library when manipulating attachments’ paths.

Now, it’s time to leave the preliminaries behind and continue exploring the numerous features offered by Swift Mailer. Let’s jump in! 



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 9 - Follow our Sitemap

Dev Shed Tutorial Topics: