informatica:linux:php:mail
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
informatica:linux:php:mail [2007/11/04 23:17] – created 192.168.1.12 | informatica:linux:php:mail [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
Instalamos paquetes necesarios de PEAR. Yo he instalado: php-mail, php5-dev, php-net-mail, | Instalamos paquetes necesarios de PEAR. Yo he instalado: php-mail, php5-dev, php-net-mail, | ||
+ | He creado la funcion / | ||
+ | Devuelve OK o el error si no se envía: | ||
- | <? | + | |
- | require_once " | + | |
- | + | { | |
- | $from = "Ose < | + | |
- | $to = "Jose < | + | |
- | $subject = " | + | $from = $arg1; |
- | $body = " | + | $to = $arg2; |
- | + | $subject = $arg3; | |
- | $host = " | + | $body = $arg4; |
- | $username = " | + | |
- | $password = " | + | $host = " |
- | + | $username = " | |
- | $headers = array (' | + | $password = " |
- | ' | + | |
- | ' | + | $headers = array (' |
- | $smtp = Mail:: | + | ' |
- | array (' | + | ' |
- | ' | + | $smtp = Mail:: |
- | ' | + | array (' |
- | ' | + | ' |
- | + | ' | |
- | $mail = $smtp-> | + | ' |
- | if (PEAR:: | + | |
- | echo("< | + | $mail = $smtp-> |
- | } else { \\ | + | if (PEAR:: |
- | echo("< | + | |
- | } \\ | + | |
- | ?> | + | } |
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | ?> | ||
+ | Para enviar un correo. El echo es para que devuelva la salida OK o el error:\\ | ||
+ | <? | ||
+ | include correo; | ||
+ | echo correo ("Jose < | ||
+ | echo correo (" | ||
+ | ?> | ||
informatica/linux/php/mail.1194218272.txt.gz · Last modified: 2015/04/13 20:19 (external edit)