PHP
  Home arrow PHP arrow Dynamically Attaching Files with Swift Mailer
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
iPad news and developer info.
Ads by affinity 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
VPS Hosting 
Forums Sitemap 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Dynamically Attaching Files with Swift Mailer


By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 1
    2010-02-24


    Table of Contents:
  • Dynamically Attaching Files with Swift Mailer
  • Review: handling attachments with Swift Mailer
  • Attaching dynamically-generated files
  • Dynamically changing the name of an attachment

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Summary: In this eighth part of a ten-part series on the Swift Mailer email library, you'll learn how to attach files that have been dynamically generated to an email message. In addition, you'll see how to use Swift Mailer's "setFileName()" method to modify the name of an attachment before it's sent, which speaks for itself about this library's flexibility.

    Dynamically Attaching Files with Swift Mailer
    (Page 1 of 4 )

    In case you haven’t heard about it yet, Swift Mailer is a comprehensive library written in PHP 5 and freely available at http://swiftmailer.org. It allows you to develop email applications very quickly and with minor effort, through a cohesive and highly intuitive programming interface.

    So, if you’re a PHP developer interested in taking advantage of the most relevant features provided by this solid email package, or simply want to take a quick look at what it can do for you, then start reading this series of articles right now!

    Being one of the most powerful email packages available nowadays that really uses a strict object-oriented approach and a correct implementation of some popular design patterns, Swift Mailer will let you perform all sorts of clever tasks when building email programs with PHP. These include sending email messages in HTML, handling inline attachments, manipulating MIME headers with ease, and so forth.

    And now that I've talked about handling attachments with Swift Mailer, I left off the last tutorial discussing how to use the “Swift_Attachment” class included with the library to attach a single file to an email message first from a local server, and then from a remote host.

    Thanks to the intrinsic flexibility given by the “fromPath()” method that belongs to the handy “Swift_Attachment” class, not only is it possible to perform these tasks with attachments, but it’s also feasible to achieve even more useful things with them, such as changing their names on the fly or embedding a dynamically-generated file into an email message.

    Sounds pretty interesting, right? So, in this eighth part of the series I’m going to explain, as usual with a decent number of code samples, how to perform the previous attachment operations in a few simple steps.

    Are you ready to keep learning more about the Swift Mailer library? Then click on the link below and read the next lines!



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

       

    PHP ARTICLES

    - MVC and the Zend Framework
    - PHP: Rendering Web Pages Using the Composite...
    - PHP: Creating Dynamic Web Pages with the Com...
    - Secure Encrypting and Decrypting for Your PH...
    - PHP: Creating Single View Objects with the C...
    - PHP: View Object Collections and the Composi...
    - Securing Your PHP Website
    - Determine Link Relevance and Unique Class C ...
    - PHP Composite View Design Pattern: Introduci...
    - Facebook PHP API Applications: A Second Look
    - Secure PHP Programming
    - Facebook PHP API Applications: Basic Introdu...
    - SOAP Servers and Web Services
    - Using XPath, SOAP, and More with Web Services
    - Web Services: SimpleXML


    Code Analysis Tools
    Enterprise code analysis tools that deliver quality and reliable code



    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek