[wp-hackers] calling wp_mail on init

Rafael Ehlers rafaehlers at gmail.com
Tue Nov 6 02:25:12 UTC 2012


Im having a problem with wp_mail dont sending emails on a function called
on a init hook:

function function_name() {  if($_GET['pass']){ wp_mail($email, $subject,
$msg, $headers ); } }
add_action('init','function_name');

I´ve read here
http://wordpress.stackexchange.com/questions/44387/wp-mail-is-undefined that
I may be calling the function wp_mail too early.

But I really need to catch this $_GET on init so that I can properly show a
message to a user on a regular page.
If I use plugins_loaded I can´t pass the vars to display on a regular page
after.

I´ve tried to use require_once(ABSPATH . WPINC . '/pluggable.php'); but it
wont work either.

Any ideas?!

Thanks!


More information about the wp-hackers mailing list