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.
Datei:
eznewsletterfiletransport.php
Projekt:
EVE-Corp-Center/ECC-Website
Datei:
blog_entry_creator.php
Projekt:
Qafoo/blog-examples
Datei:
mta_transport.php
Projekt:
mdb-webdev/livehelperchat
Datei:
ezpmail.php
Projekt:
brookinsconsulting/ezecosystem
Datei:
smtp_transport.php
Projekt:
brookinsconsulting/ezecosystem
Datei:
composer.php
Projekt:
DaveNascimento/civicrm-packages
Datei:
tutorial_examples.php
Projekt:
notion/zeta-mail
Datei:
mail_test.php
Projekt:
jacomyma/GEXF-Atlas
Datei:
tools_test.php
Projekt:
jacomyma/GEXF-Atlas
Datei:
tutorial_charset.php
Projekt:
notion/zeta-mail
Datei:
tutorial_mail_simple.php
Projekt:
notion/zeta-mail
Datei:
multipart_test.php
Projekt:
notion/zeta-mail
Datei:
mail.php
Projekt:
jordanmanning/ezpublish
Datei:
tutorial_extend_use.php
Projekt:
notion/zeta-mail
Datei:
transport_imap_test.php
Projekt:
notion/zeta-mail
Datei:
composer_test.php
Projekt:
bmdevel/ezc
Datei:
send_digest.php
Projekt:
Qafoo/blog-examples
Datei:
tools.php
Projekt:
agroknow/mermix
Datei:
tutorial_tools.php
Projekt:
notion/zeta-mail