dev-master
9999999-dev https://github.com/TiiToo/ZetaWebmailBundleSymfony2 Send and Recibe Mail
MIT
by Tito
mail webmail zeta
Symfony2 Send and Recibe Mail
A flexible Mail bundle for Symfony2 for sending and displaying purposes You can show mailbox contents and mails loaded from arbitrary sources. Zeta Components is used to parse mails and access IMAP/POP sources, a simple interface is provided to allow any source of mails such as a database or the filesystem., (*1)
Zeta Components sending and composing capabilities are also leveraged, a transporting service is provided, making this bundle a dropin replacement for SwiftMailerBundle., (*2)
The transporting service is integrated into the WebDebugToolbar and shows the number of sent mail per request and shows their headers. Zeta Webmail Bundle ships with a NullTransport that can be used for sending in development., (*3)
Install Zeta Components, (*4)
Currently this has still to be done through the old ezcomponents.org PEAR channel:, (*5)
pear channel-discover components.ez.no pear install -a ezc/eZComponents
Add the following lines to your autoload.php:, (*6)
require_once "ezc/Base/base.php"; spl_autoload_register(array("ezcBase", "autoload"));
Add following lines to your composer.json file:, (*7)
"require": {, (*8)
... "tito/zeta-webmail-bundle": "dev-master"
}, (*9)
Register Autoloading namespace SimpleThings into app/autoload.php, (*10)
Add Bundle to app/AppKernel.php, (*11)
public function registerBundles() { $bundles = array( //.. new SimpleThings\ZetaWebmail\SimpleThingsZetaWebmailBundle(), //.. ); return $bundles; }
Configure bundle in app/config.yml, (*12)
simple_things_zeta_webmail: security: admin_party list_layout: SimpleThingsZetaWebmailBundle::standalone.html.twig sources: gmail: type: imap host: imap.gmail.com username: xxx@gmail.com password: s3cr3t ssl: true other: type: pop host: pop.foo.de username: user password: s3cr3t ssl: true
You can also add the following routing files for the mailing viewer and the composer:, (*13)
zeta_webmail: resource: "@SimpleThingsZetaWebmailBundle/Resources/config/routing.yml" prefix: /zeta zeta_webmail_composer: resource: "@SimpleThingsZetaWebmailBundle/Resources/config/routing_composer.yml" prefix: /zeta
To add your own source for mails implement SimpleThings\ZetaWebmail\Mailbox\Loader\MailboxLoader
and
SimpleThings\ZetaWebmail\Mailbox
. You can then register this loader by specifying its service-id
in the "type" key of your source:, (*14)
simple_things_zeta_webmail: security: admin_party sources: test: type: my.zetawebmail.loader.service
Be aware that the pagination in the Mailbox interface is based on message numbers, i.e. ascending by date starting with message number 1 and ending with message number equaling the message count., (*15)
To protect mails from being read without proper access there is a very small abstraction layer for security built into the Webmail bundle. By default there are two very simple security roles shipped with the bundle:, (*16)
This bundle uses washtml to sanitize HTML mail content before displaying. Not the original code but an object-oriented modification written by Roundcube developers is used for this task., (*17)
By default images are not displayed and replaced with an empty local image. A message box appears on top of the mailing and allows users to decide to display the images or not., (*18)
There are two routes that you can use to integrate either a list of mails or a view of a mail into your application:, (*19)
The view mail route should ALWAYS be contained into an iframe, since otherwise HTML mails will render themselves into your application layout. I suggest using at least 600 width for the iframe, which a standard size for preview windows., (*20)
The list view does not use a layout itself so you can use the {% render %} command from Twig to display this as an widget where ever you please., (*21)
To send mails you have to configure the transport to send with:, (*22)
simple_things_zeta_webmail: transport: type: smtp host: localhost user: foo password: bar port: 1234
You can access this service by accessing:, (*23)
$mail = new \ezcMailComposer(); // compose the mail here... $transport = $container->get("simplethings.zetawebmail.transport"); $transport->send($mail);
The following transports are shipped:, (*24)
The FOS\UserBundle has an abstraction layer for mails that are sent for confirmation and reset password purposes. The ZetaWebmailBundle ships with a replacement of the default SwiftMailer implementation., (*25)
Just put the following in your app/config/config.yml to get rid of Swiftmailer:, (*26)
fos_user: # ... service: mailer: simplethings.zetawebmail.fosuser.mailer
This service uses the transport service defined before for sending mails., (*27)
Symfony2 Send and Recibe Mail
MIT
mail webmail zeta