bootstrap

Another excellent Edublogs.org weblog

Using SMTP With Zend Framework – Solve Email Delivery Problem, Tech Chorus

September 27th, 2009 · Tidak ada Komentar
Uncategorized




PHP popular provides the mail() mould. But it requires decorously configured despatch server on the hamlet prime mover. Developers in many cases don’t experience the fated infrastructure at their disposal.
The PHP handbook number states that the mail() mould is not fit owing larger volumes of email in a hoop as it opens and closes an SMTP socket owing each despatch.

Sometimes sending emails from a PHP calligraphy becomes a frustrating acquaintance. above all The mail() mould on Linux depends on hamlet consecration of sendmail. During the to-do include of your prepare the fated email infrastructure may not be at one’s fingertips to you.

To successfully send an email using the mail() mould you experience to experience a decorously configured MTA on the gathering. Due to these infrastructure problems the emails you send using the mail() mould may not be delivered.
How do you mould this difficult?
To mould the email utterance difficult, you put into practice a decorously configured email server. Many receiving email servers may survey your emails as SPAM. From your PHP calligraphy you solder to this decorously configured email server via SMTP and send emails. If you experience subscribed to a spider’s web and email hosting utility, you can put into practice the despatch server provided next to your spider’s web hosting provider.

But, who command produce me access to a decorously configured email server?
Most apposite, your assembly has already provided you an email account with POP and SMTP access. If you already don’t experience an email account with SMTP access, judge call in on of bountiful email utility providers like Gmail.
Once you experience an email account you command instruct the following poop
SMTP server hostname
SMTP username: in the main it is your fully email address
Password: the open sesame you put into practice to login to your email account
Once you apply the greater than details from your email server administrator or provider you are keen to start editorial the calligraphy. Gmail provides bountiful POP, IMAP and SMTP access to all Gmail accounts.

How do we solder to the slim email server from our PHP calligraphy? We could uncovered a socket coherence to the email server and make available with it from our PHP calligraphy. Why not judge call in on of these libraries? Using an uncovered rise third champion library like the Zend Framework saves tombola of to-do temporarily and drive. People experience written libraries in PHP to make available with email servers.
In this epitome, we put into practice the Zend_Mail component of the Zend Framework. In a quondam blog chore we discussed the reasons to put into practice Zend Framework. Zend Framework is a PHP5 framework with burly issue of unaligned components. In this epitome, we do not put into practice the MVC components of Zend Framework.

Familiarize yourself with particular components of the Zend Framework an individual at a temporarily. If you are callow to frameworks it is a complete manner to start using the Zend Framework. Learning a framework takes some temporarily.

Installing the Zend Framework
To initiate the Zend Framework, you download the tarball (or zip file) from framework.zend.com and photocopy it to the library directory of your prepare. With this attract you can calibration the knowledge curve smoothly. Let’s initiate it move next to move. You can diminish all the libraries – third champion and your own in the library directory.
Step 1: Do you experience a ‘library’ directory in your prepare? If not beget an individual any more.
Step 2: Download the Zend Framework.

At the tuchis of the number detect the download coupling on the unmodified pandemonium as “Zend Framework 1.9.3 innervate 1 Minimal” and click it.
Visit http://framework.zend.com/download/latest. At the temporarily of editorial 1.9.3PL is the latest unloose. above all
Step 3: Extract the archive and photocopy the Zend directory to your project’s library directory. Save the archive in your downloads directory.
tar -zxvf ZendFramework-1.9.3PL1-minimal.tar.gz
cp -a ZendFramework-1.9.3PL1-minimal/library/Zend/ /path/to/your/project/library/
After copying your prepare directory configuration should look like
projectdir/library/Zend/
Writing the email script
Create the mark in kind sendemail.php.

Let us prime fit up the include_path. We command diminish our PHP jus civile ‘civil law’ in sendemail.php.
My directory configuration is as follows
web/mail/sendemail.php
library/Zend/
From within sendemail.php I experience to range to above all../../library to access the directory Zend.

Create a free edublog to get your own comment avatar (and more!)