Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Zend Framework 2 Cookbook

You're reading from   Zend Framework 2 Cookbook If you are pretty handy with PHP, this book is the perfect way to access and understand the features of Zend Framework 2. You can dip into the recipes as you wish and learn at your own pace.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849694841
Length 340 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
joseph@callaa.rs joseph@callaa.rs
Author Profile Icon joseph@callaa.rs
joseph@callaa.rs
Josephus Callaars Josephus Callaars
Author Profile Icon Josephus Callaars
Josephus Callaars
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Zend Framework 2 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Zend Framework 2 Basics FREE CHAPTER 2. Translating and Mail Handling 3. Handling and Decorating Forms 4. Using View 5. Configuring and Using Databases 6. Modules, Models, and Services 7. Handling Authentication 8. Optimizing Performance 9. Catching Bugs Setting up the Essentials Index

Sending mail


Sending e-mail through sendmail is usually a pretty standard way of working, as it is probably one of the most used ways of transporting e-mail (or proxying the e-mail to an SMTP server) on a Linux-based system. On most Linux servers sendmail is already installed and therefore it's very easy to start sending e-mail with that.

That is why we will be discussing this method of sending e-mail first, so that we can start off easy.

How to do it…

In this recipe we will discuss the method of sending mail from within our application.

Transport\Sendmail

Let's take a look at the following example of sending an e-mail through sendmail, and although this functionality is placed in a controller, in real life this needs to stay far away from that and be placed safely away in a model:

<?php

namespace Application\Controller;

// We need the following libraries at a minimum to 
// send an e-mail.
use Zend\Mail\Message;
use Zend\Mail\Transport\Sendmail;
use Zend\Mvc\Controller\AbstractActionController...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image