Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/01/2010, 01:59
albertrc
 
Fecha de Ingreso: febrero-2009
Mensajes: 443
Antigüedad: 15 años, 2 meses
Puntos: 1
se puede enviar correos desde un formulario a gmail sin utilizar phpmailer

es que con phpmailer solo valida el correo i el assumpto i yo quiero que tanbien valide el nombre i descripcion
estoy haciendo validaciones desde formulario pero simpre son primero las del fichero

Código PHP:
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

$mail->IsSMTP(); // telling the class to use SMTP

  
$mail->Host       "localhost"// SMTP server

  
$mail->SMTPDebug  2;                     // enables SMTP debug information (for testing)

  
$mail->SMTPAuth   true;                  // enable SMTP authentication

  
$mail->SMTPSecure "ssl";                 // sets the prefix to the servier

  
$mail->Host       "smtp.gmail.com";      // sets GMAIL as the SMTP server

  
$mail->Port       465;                   // set the SMTP port for the GMAIL server

  
$mail->Username   "[email protected]";  // GMAIL username

  
$mail->Password   "*******";            // GMAIL password


$mail->AddAddress(strtolower($_POST['correo']),strtolower($_POST['nombre']) );
$mail->SetFrom('[email protected]''negocio');
$mail->Subject=("negocio ".strtolower($_POST['assumpto']));
$mail->MsgHTML(strtolower($_POST['mensaje']));

$mail->Send(); 

Última edición por albertrc; 13/01/2010 a las 02:05