php - Call to undefined function wp_mail -


hi im using function wordpress in cron webpage , throwing error on email

fatal error: call undefined function wp_mail() in /home/meusite/public_html/wp-content/themes/escotec/page-cron.php on line 33

here code

foreach($inscricoes $key => $item){        $emailsent = false;        $emailto = "$item->getemail()";  //echo "..1";      $subject = '[escotec]: dados para pagamento de inscrição ';     $body = "parabéns $inscricao->nome, sua inscrição no curso ".$item->getturmas()[0]->getcurso()->getnome()." foi efetuada. <p>para concluir o pagamento da inscrição clique no link abaixo ou cole-o diretamente na barra de endereços de seu navegador: </p><br>";     $body .= "<a href=\"http://escotecnordeste.com.br/pagamento/?email=".$item->getemail()."&pedido=".$item->getpagamentoid()."\" target=\"_blank\">http://escotecnordeste.com.br/pagamento/?email=".$item->getemail()."&pedido=".$item->getpagamentoid()."</a>";     $headers = 'from: escotec nordeste <escotecnordeste@gmail.com>' . "\r\n" . 'reply-to: ' . 'escotecnordeste@gmail.com';          wp_mail($emailto, $subject, $body, $headers);       $emailsent = true; // http://escotecnordeste.com.br/pagamento/?email=leandrocezar.dev@gmail.com&pedido=11  // codificar envio e-mail     if ($emailsent) {     // atualizar registro pedido para email_enviado = 's'          inscricaodao::registraenvioemail($item->getpagamentoid());     } } 

ty

please add below code in file. have called wp_mail() function.

add code top of file.

require_once("../../../wp-load.php"); 

or change function wp_mail() mail()


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -