You can use ezcMail together with the other classes derived from ezcMailPart
to build email messages. When the mail is built, use the Transport classes
to send the mail.
This example builds and sends a simple text mail message:
$mail = new ezcMail;
$mail->from = new ezcMailAddress( 'sender@example.com', 'Adrian Ripburger' );
$mail->addTo( new ezcMailAddress( 'receiver@example.com', 'Maureen Corley' ) );
$mail->subject = "Hi";
$mail->body = new ezcMailText( "I just mail to say I love you!" );
$transport = new ezcMailMtaTransport();
$transport->send( $mail );
By default, the ezcMail class will generate a mail with the Bcc header inside,
and leave it to the SMTP server to strip the Bcc header. This can pose a
problem with some SMTP servers which do not strip the Bcc header
(issue #16154: Bcc headers are not stripped when using SMTP). Use the option
stripBccHeader from {@link ezcMailOptions} to delete the Bcc header from
the mail before it is sent.
Example:
$options = new ezcMailOptions();
$options->stripBccHeader = true; // default value is false
$mail = new ezcMail( $options );
You can also derive your own mail classes from this class if you have
special requirements. An example of this is the ezcMailComposer class which
is a convenience class to send simple mail structures and HTML mail.
There are several headers you can set on the mail object to achieve various
effects:
- Reply-To - Set this to an email address if you want people to reply to an
address other than the from address.
- Errors-To - If the mail can not be delivered the error message will be
sent to this address.
File:
eznewsletterfiletransport.php
Progetto:
EVE-Corp-Center/ECC-Website
File:
blog_entry_creator.php
Progetto:
Qafoo/blog-examples
File:
mta_transport.php
Progetto:
mdb-webdev/livehelperchat
File:
ezpmail.php
Progetto:
brookinsconsulting/ezecosystem
File:
smtp_transport.php
Progetto:
brookinsconsulting/ezecosystem
File:
composer.php
Progetto:
DaveNascimento/civicrm-packages
File:
tutorial_examples.php
Progetto:
notion/zeta-mail
File:
mail_test.php
Progetto:
jacomyma/GEXF-Atlas
File:
tools_test.php
Progetto:
jacomyma/GEXF-Atlas
File:
tutorial_charset.php
Progetto:
notion/zeta-mail
File:
tutorial_mail_simple.php
Progetto:
notion/zeta-mail
File:
multipart_test.php
Progetto:
notion/zeta-mail
File:
mail.php
Progetto:
jordanmanning/ezpublish
File:
tutorial_extend_use.php
Progetto:
notion/zeta-mail
File:
transport_imap_test.php
Progetto:
notion/zeta-mail
File:
composer_test.php
Progetto:
bmdevel/ezc
File:
send_digest.php
Progetto:
Qafoo/blog-examples
File:
tools.php
Progetto:
agroknow/mermix
File:
tutorial_tools.php
Progetto:
notion/zeta-mail