cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Mail component

Open niden opened this issue 14 years ago • 18 comments

I would like to see a Mail component in the framework.

The component encapsulate sending mail over Sendmail (linux) or SMTP with local/remote connections.

from to message headers cc bcc attachments

should be considered as core.

niden avatar Sep 10 '12 18:09 niden

This requirement is scheduled for 0.6.0

ghost avatar Sep 12 '12 04:09 ghost

Mail component can be inspired by CakeEmail component. Easy to use and understand, not complicated (like Symfony one)

See: http://book.cakephp.org/2.0/en/core-utility-libraries/email.html

hdogan avatar Oct 01 '12 20:10 hdogan

On c it will work much more faster, also if it will be native framework solution, it will be much easier. Perhaps, it could be less priority component, but if implementation will be nice (we have many examples to overview before start) - i would use it (i suppose many other users will too).

alvassin avatar Dec 24 '12 00:12 alvassin

In my opinion Mail component currently not required for phalcon. There is a lot of library component for this job. One of this library is \Zend\Mail

The library very useful with DI.

<?php
$di = new \Phalcon\DI\FactoryDefault();

$di->set('mail', function() {
    return new \Zend\Mail\Transport\Sendmail();
}, true);

$mail = new \Zend\Mail\Message();
$mail->setBody('This is the text of the email.');
$mail->setFrom('[email protected]', 'Sender\'s name');
$mail->addTo('[email protected]', 'Name o. recipient');
$mail->setSubject('TestSubject');

$di->get('mail')->send($mail);

tugrul avatar Feb 03 '13 13:02 tugrul

Perhaps you could look at the Ruby on Rails implementation on sending emails. E-mails are a lot like controllers, handling data and views and linking the two. I would love to see this implemented in Phalcon:

http://guides.rubyonrails.org/action_mailer_basics.html

ibrahimab avatar Mar 17 '13 07:03 ibrahimab

@tugrul Zend is VERY heavy library, it's not good practice to import all Zend into project just because of it's mail component (otherwise you will have big workaroung filtering out required files).

Anyway, zend implementation is very nice, except some little bugs.

alvassin avatar Apr 30 '13 09:04 alvassin

Yup, till nowdays, there is no standalone php mail library following PSR standards.. We're waiting for this component very much :)

alvassin avatar Apr 30 '13 10:04 alvassin

@avasin you are partially right. You don't need import every component of Zend to use Mail component. Zend Framework 2 seperated modules for each different tasks. I hate the Application model of Zend Framework 1 and 2 but Mail component is good part of Zend Framework 2.

tugrul avatar Apr 30 '13 12:04 tugrul

For me PHPMailer is good enough.

mruz avatar May 03 '13 10:05 mruz

:+1: My favorite is Zend Mail or swiftmail in this order

Cmssspl avatar May 04 '13 21:05 Cmssspl

Well, for me the best library to sending emails is http://swiftmailer.org . Stable, good documentation, simple to use.

Riu avatar May 06 '13 20:05 Riu

PHPMailer is not psr-compatible. Don't remember if swiftmailer is.

alvassin avatar May 06 '13 21:05 alvassin

:+1:

roman-kulish avatar May 10 '13 01:05 roman-kulish

As for me, mail component is not needed inside of the core.

p0rsche avatar May 10 '13 07:05 p0rsche

+1

Nowadays, you have swiftmailer which is great but too heavy. This addition could make phalconphp the best framework for applications demanding huge usage of mailing.

carlosjac avatar May 10 '13 14:05 carlosjac

+1

ghost avatar May 13 '13 05:05 ghost

-1 becase I'm agree with @tugrul

Mail component currently not required for phalcon. There is a lot of library component for this job.

It's better to focus on other issues

iforp avatar May 13 '13 15:05 iforp

After further discussion, we decided not to pursue this issue for the time being.

The reason behind this is that a mail component has very little to gain from Phalcon. Once you have your content, you just set it up in the object and from then on it is all network traffic i.e. connect to the other server, transfer the email and close the connection.

Applications mentioned here as swiftmailer, phpmailer or any other can easily be included in our applications for the purpose of sending emails.

Perhaps in the future we might tackle this again but for the time being we will concentrate our efforts on other issues.

niden avatar May 22 '13 17:05 niden