Last active
August 29, 2015 14:20
-
-
Save manviny/706d290e58a33ffffbf3 to your computer and use it in GitHub Desktop.
Función para enviar email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$plantilla = "clientes"; | |
$municipio = "Paterna"; | |
foreach ( $pages->get("template=$plantilla")->children("cli_municipio=$municipio") as $hijo) { | |
sendEmail( '[email protected]', $hijo->email, 'cafelin', 'venga que empieza la clase'); | |
echo $hijo->email; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* NEEDS wireMail SMTP module to be installed and configured properly | |
*/ | |
function sendEmail($from, $to, $subject, $message){ | |
$mail = wireMail(); | |
$mail->to($to)->from($from); // all calls can be chained | |
$mail->subject($subject); | |
$mail->body($message); | |
$mail->bodyHTML($message); | |
$mail->send(); | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment