Cargando la página...

Enviar Mail

Por hackemfunlimited el 24 de octubre de 2009 en los siguientes foros: PHP

Enviar Mail

Avatar de hackemfunlimited
ALGUIEN SABE COMO ENVIAR EMAIL A CUALQUIER CUENTA DE CORREO ELECTRONICO
EN PHP AVER SI ME DAN UNA MANITO

Respuestas

1
24
octubre
2009
Avatar de Gastón

Gastón 0 puntos

Lo más fácil es usar la función mail:

bool mail  ( string $to  , string $subject  , string $message  [, string $additional_headers  [, string $additional_parameters  ]] )


Aca tenés un ejemplo sencillo:

<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>


Tenés que cuidar bien que no te inyecten código malicioso, la función mail solo se encarga de enviar el email, no valida nada.

Si buscas algo más completo, podes buscar sobre las funciones de email de PEAR o PHPmailer.

Saludos.

Tema cerrado por inactividad mayor a 90 días