Hello,
I work on my first elgg project.
My sendmail app need somme spécific params to work.
But i Can't edit my php.ini file.
My first (and only solution), is to hack the elgg code :'(
engine/lib/notification.php elgg_send_email()
return mail($to, $subject, wordwrap($body), $headers);
replaced by
return mail($to, $subject, wordwrap($body), $headers, ' -f elgg@foo.fr'); // HACK : ajout de ' -f elgg@foo.fr'
I'm looking for a best solution.
Thanks for your help :)
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- Rémy@remy_php
Rémy - 0 likes
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- Rémy@remy_php
Rémy - 0 likes
- v06@new_hero
v06 - 0 likes
- Rémy@remy_php
Rémy - 0 likes
You must log in to post replies.If you look at elgg_send_email()
There is a hook you can use (I think it's 'email', 'system') - and there you can send the email using mail() with the 5th parameter and return true in your hook to let the function know you've handled it. This will allow you to implement your solution in a plugin and not hack the core.
good :)
I do not know the hook system.
http://docs.elgg.org/wiki/Plugin_Hooks
I assume you know about the plugin skeleton, start.php and the init function - if not you'll need to read up on that in the docs
in your init function it'll be something like
elgg_register_plugin_hook_handler('email', 'system', 'myplugin_mailer');
Then you'll define your new function
function myplugin_mailer($hook, $type, $return, $params) {
// $params will have all of the info you need
send your email using mail()
return true; // returning true will stop the core mail() call
}
good job buddy.but i have one question,it is safe for user
I have no idea. Why then does he not be?
It's just a hook that does 'exactely' the default functionality.