<?php$my_module='foo';$my_mail_token='bar';$from=variable_get('system_mail','info@test.net');$message=array('id'=>$my_module.'_'.$my_mail_token,'to'=>'debug@test.net','subject'=>'Prueba de envío','body'=>array('test'),'headers'=>array('From'=>$from,'Sender'=>$from,'Return-Path'=>$from,),);$system=drupal_mail_system($my_module,$my_mail_token);// The format function must be called before calling the mail function. $message=$system->format($message);if($system->mail($message)){// Success.echo'sucess';}else{// Failure.echo'failure';}
Comments (2)
Jorge Tutor
Útil para ver si el servidor de correo funciona, copiar y pegar en devel/php por ejemplo.
Útil para ver si el servidor de correo funciona, copiar y pegar en devel/php por ejemplo.
http://www.jeffgeerling.com/blogs/jeff-geerling/wrapper-function-simple