[wp-hackers] calling wp_mail on init

Rafael Ehlers rafaehlers at gmail.com
Tue Nov 6 03:23:20 UTC 2012


Just tried, still not working! Thanks for the tip Kirk!


2012/11/6 Kirk Wight <kwight at kwight.ca>

> Maybe try calling on wp_loaded instead of init?..
>
>
> On 5 November 2012 21:25, Rafael Ehlers <rafaehlers at gmail.com> wrote:
>
> > 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-undefinedthat
> > 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!
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list