Ver Mensaje Individual
  #22 (permalink)  
Antiguo 27/02/2012, 21:40
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 14 años, 2 meses
Puntos: 6
Respuesta: recuperar contraseña mediante un email de sistema de usuarios

lo integre a lo que me indicas

no funciona

Fatal error: Call to undefined method PHPMailer::SetFrom() in C:\AppServ\www\calendario\views\recu.php on line 70

Código PHP:
Ver original
  1. require("class.phpmailer.php");
  2. $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
  3. $mail->SetLanguage("es", 'phpMailer/language/');
  4. $mail->IsSMTP(); // telling the class to use SMTP
  5.  
  6. try {
  7.   $mail->Host       = "smtp.live.com"; // SMTP server
  8.   $mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
  9.   $mail->SMTPAuth   = true;                  // enable SMTP authentication
  10.   $mail->Host       = "smtp.live.com"; // sets the SMTP server
  11.   $mail->Port       = 26;                    // set the SMTP port for the GMAIL server
  12.   $mail->Username   = "[email protected]"; // SMTP account username
  13.   $mail->Password   = "yourpassword";        // SMTP account password
  14.   $mail->AddReplyTo('[email protected]', 'First Last');
  15.   $mail->AddAddress('[email protected]', 'John Doe');
  16.   $mail->SetFrom('[email protected]', 'First Last');
  17.   $mail->AddReplyTo('[email protected]', 'First Last');
  18.   $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  19.   $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  20.   $mail->MsgHTML(file_get_contents('contents.html'));
  21.   $mail->Send();
  22.   echo "Message Sent OK<p></p>\n";
  23. } catch (phpmailerException $e) {
  24.   echo $e->errorMessage(); //Pretty error messages from PHPMailer
  25. } catch (Exception $e) {
  26.   echo $e->getMessage(); //Boring error messages from anything else!
  27. }