News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso:
Sending automated emails with PHP, Swiftmailer and Twig
September 24, 2013 @ 11:40:57

Gonzalo Ayuso has posted a new tutorial today showing you how to combine PHP, Swiftmailer and Twig to send automated emails from your application.

My work as host is basically pick the place and encourage people to join to the Coding Dojo. One way of doing this (besides twitter buzz) is take my address book and send one bulk email to all of them inviting to join us. I don't like this kind of mails. They look like spam, so I prefer to send a personalized email. This email has a common part (the place location, the hour, the event description, ...) and the personalized part. I can do it manually, the list isn't so huge, but definitely that's not cool. Because of that I have done a little script to perform this operation.

His example extracts the information from a simple spreadsheet exported as a CSV file. He creates a simple Mailer class that uses Swiftmailer to do the actual sending. You pass in the Twig rendering object (Twig_Environment) that's used to render the email output. He includes a "Spammer" class that uses the Symfony EventDispatcher to send the email if everything works or an error email if something fails. He then drops it all into a Symfony Console command structure, defines several configuration settings in a "config.yml" and makes the script to execute the commands.

0 comments voice your opinion now!
email swiftmailer twig template tutorial symfony console eventdispatcher

Link: http://gonzalo123.com/2013/09/23/sending-automated-emails-with-php-swiftmailer-and-twig

PHPMaster.com:
Sending Email with Swift Mailer
December 04, 2012 @ 11:34:54

On PHPMaster.com today there's a new tutorial showing you how to use Swift Mailer, a popular (and well-established) mailing tool.

Sending emails programmatically is a common task that programmers must deal with often. Although you can use PHP's native functions, they can be too low-level, especially when you want to attach one or more files to your message. If you don't want to use the native functions, or if you want to send mail using an object-oriented approach, then this is the article for you. I'll introduce you to Swift Mailer, a powerful component-based library that let's you send emails easily. Started in 2005, Swift Mailer is a library that provides several classes that allow you to send emails from within your PHP scripts or web applications.

Included in the post are a basic example of sending a plain-text email, working with attachments and including a template into the body of the message (with spots to fill text in).

0 comments voice your opinion now!
swiftmailer introduction tutorial email pear


Sebastian Göttschkes:
symfony2 Testing email sending
September 13, 2012 @ 08:52:03

Sebastian Göttschkes has a new post showing a method he's come up with to test email sending in a Symfony2 application.

On my endless struggle to achieving 100% code coverage and catching every possible (and impossible) test case (I'm just kiddinh, please don't do this!) I was in need for some way to test the sending of emails. This blog post will show you how to test this within a symfony2 (I'm using symfony 2.1 RC2) application, using the default swiftmailer.

It's not unit testing, it's functional testing, and he provides a bit of background on the process first then sets up a dummy listener for testing and how to plug in the Symfony2 functionality (via a getContainer call to get the DIC).

0 comments voice your opinion now!
symfony2 swiftmailer testing webtest email send


Web Development Blog:
PHP Mail Scripts using SMTP transport, a guide for beginners
April 12, 2010 @ 10:47:47

From the Web Development Blog today there's a new tutorial showing you how to use STMP from PHP via one of three different tools - the Zend_Mail component of the Zend Framework, SwiftMailer and PHPMailer.

PHP has a very simple mail function which is used very often for basic text mail messages. What if you need to attach files or if you need to send your e-mail messages via SMTP? Than it's time to use a more advanced script. This is because the standard mail function has only limited standard capabilities.

Snippets of code are included for each of the three showing how to send a simple email with the usual "To", "From" and body contents. All of the tools have the ability to include attachments, but that's not included here.

0 comments voice your opinion now!
smtp tutorial beginner swiftmailer zendmail phpmailer


Fabien Potencier's Blog:
Swift Mailer Takeover
September 17, 2009 @ 10:44:03

As is mentioned in the latest post to his blog, Fabien Potencier has taken over as the project manager for the SwiftMailer project:

This is a great honor for me to take over such a project. The Swift Mailer project has been initiated by Chris Corbyn some years ago. He has done a wonderful job during the years, trying to find the best way to create a top-notch emailing solution for PHP. With the release of the 4th version of Swift Mailer earlier this year, I think we now have a very solid mailing library.

As a part of the effort to expand the use of the mailing library, it will become the default emailing solution for the Symfony framework. You can learn more about Swift Mailer from the project's website.

0 comments voice your opinion now!
swiftmailer symfony project manager


PHPImpact Blog:
From Swift Mailer to Zend_Mail
June 27, 2008 @ 07:55:48

On the PHP::Impact blog, there's a new post talking about his conversion from Swift Mailer over to the Zend_Mail component of the Zend Framework.

I've recently switched from Swift Mailer to Zend_Mail and, to be honest, I'm loving it. Finally someone developed a lightweight, powerful and easy to use Mail component!

He includes an example or two showing a basic mailer script, one that uses a fluent interface, one sending an HTML email and two that show how to use a remote SMTP server.

1 comment voice your opinion now!
zendmail swiftmailer change example tutorial zendframework


Symfony Blog:
How to send emails in symfony 1.1
June 12, 2008 @ 10:25:29

On the Symfony blog, there's a new post showing the answer to a common question framework users have - what's the best way to send emails from inside our framework applications.

Sending mails is a web developer's everyday task, and symfony 1.1 let you do this easier than ever using Swift Mailer. Swift Mailer is a well thought, fully featured PHP5 object library that will cover 120% of your mailing needs.

They show how to create a partial or a component in your application that generates the content for the emails and pushes that result out to the Swift Mailer application. They show the (simple) installation from a svn checkout and two examples of sending emails, one simple and another with a multipart message.

1 comment voice your opinion now!
send email symfony framework swiftmailer component tutorial


Zend Developer Zone:
PHP Abstract - Episode 6 SwiftMailer
June 22, 2007 @ 08:32:00

The Zend Developer Zone has posted their latest episode of their podcast - PHP Abstract - with a show hosted by Chris Corbyn on SwiftMailer.

Our special guest today is Chris Corbyn. Chris is a professional Software Engineer based in the United Kingdom. He is fluent in PHP, JavaScript, XHTML as well as database design and management. In his spare time, Chris enjoys Snooker and Badminton.

Chris is going to talk to us about his open source project, SwiftMailer and how it can help you in your PHP applications.

The show mentions both SwiftMailer and the the PHP Developer's Network. You can grab the download directly from here or just subscribe to the podcast's feed here.

0 comments voice your opinion now!
podcast chriscorbyn swiftmailer phpdevelopersnetwork podcast chriscorbyn swiftmailer phpdevelopersnetwork


The Bakery Blog:
SwiftMailer Component Tutorial
December 19, 2006 @ 17:19:00

On The Bakery (the CakePHP blog) today, there's a new tutorial covering the SwiftMailer Component:

I would still advise you read the Swift Mailer documentation here: http://www.swiftmailer.org/docs/ SwiftMailer Component isn't an attempt to hide the already excellent class written by Chris Corbyn. Rather, the component tries to integrate and extend it (read, Cake-ish!).

They walk through the installation and where to unpack the download to ensure it works with your installation of CakePHP. You'll need to add the component to the main controller, but other than that, you're ready to go. From there it's configuration issues:

  • connecting to the local MTA (like sendmail or a SMTP server)
  • configuring the authentication for sending
  • and, of course, creating a message to go out
They demonstrate the creation of this through a view in the application that can natively send both HTML and plain-text emails.

0 comments voice your opinion now!
bakery cakephp tutorial swiftmailer component email bakery cakephp tutorial swiftmailer component email



Community Events





Don't see your event here?
Let us know!


voicesoftheelephpant series symfony deployment laravel community zendserver library api podcast package bugfix unittest release introduction framework language install interview opinion

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework