Forums / Developer / Simple way to send email?

Simple way to send email?

Author Message

Michael Hall

Tuesday 05 February 2008 10:20:16 pm

Is there a simple function (eZ 3.9.3) I can use to send email from a template without having to create a class and modify ini files as described in the Information Collector documentation? Something like the PHP mail() function?

If not, is it only possible to specify one EmailReceiver in [InformationCollectionSettings] per site in 'settings/siteaccess/my_site/site.ini.append.php'? I need to send an email to one specific address that is not the default.

Łukasz Serwatka

Tuesday 05 February 2008 11:53:05 pm

Hi,

There is an contribution that provide such functionality.
http://ez.no/developer/contribs/template_plugins/template_mailer

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Michael Hall

Wednesday 06 February 2008 12:39:09 am

Great, that looks like what we need. I know I should (and no doubt will) learn the more complex method, but for this particular template we don't need to store any data and don't need to retrieve or view it later. I already have the logic we need embedded into the existing template (using ezhttp) and didn't want to have to rewrite everything from scratch. Maybe not the eZ way, but time is of the essence!

Michael Hall

Wednesday 06 February 2008 9:41:21 pm

Just confirming that this solution has worked for us. Thanks again.

Example code here: http://ez.no/developer/contribs/template_plugins/template_mailer#msg158431

Hope this saves someone some time. As always, use at own risk!

Łukasz Serwatka

Wednesday 06 February 2008 11:22:59 pm

Thanks for sharing, Michael! ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog