Foros del Web » Administración de Sistemas » Apache »

error envio email

Estas en el tema de error envio email en el foro de Apache en Foros del Web. hola chicos , tengo un problema de envio de email en local, he dado mil vueltas pero no lo soluciono, tengo el php ini de ...
  #1 (permalink)  
Antiguo 04/01/2015, 05:31
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
error envio email

hola chicos , tengo un problema de envio de email en local, he dado mil vueltas pero no lo soluciono, tengo el php ini de esta manera

Código PHP:
Ver original
  1. [mail function]
  2. ; For Win32 only.
  3. ; http://php.net/smtp
  4. ;SMTP = smtp.gmail.com
  5. ; http://php.net/smtp-port
  6. ;smtp_port = 465
  7.  
  8. ; For Win32 only.
  9. ; http://php.net/sendmail-from
  10. ;sendmail_from = xxxxx@gmail.com                 [B]aqui mi correo[/B]
  11.  
  12. ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
  13. ; http://php.net/sendmail-path
  14.  sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"
  15.  
  16. ; Force the addition of the specified parameters to be passed as extra parameters
  17. ; to the sendmail binary. These parameters will always replace the value of
  18. ; the 5th parameter to mail(), even in safe mode.
  19. ;mail.force_extra_parameters =
  20.  
  21. ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
  22. mail.add_x_header = On
  23.  
  24. ; Log all mail() calls including the full path of the script, line #, to address and headers

y el sendmail asi
Código PHP:
Ver original
  1. ; configuration for fake sendmail
  2.  
  3. ; if this file doesn't exist, sendmail.exe will look for the settings in
  4. ; the registry, under HKLM\Software\Sendmail
  5.  
  6. [sendmail]
  7.  
  8.  
  9. smtp_server=smtp.gmail.com
  10.  
  11. ; smtp port (normally 25)
  12.  
  13. smtp_port=465
  14.  
  15. ; SMTPS (SSL) support
  16. ;   auto = use SSL for port 465, otherwise try to use TLS
  17. ;   ssl  = always use SSL
  18. ;   tls  = always use TLS
  19. ;   none = never try to use SSL
  20.  
  21. smtp_ssl=auto
  22.  
  23.  
  24. default_domain=gmail.com
  25.  
  26. ; log smtp errors to error.log (defaults to same directory as sendmail.exe)
  27. ; uncomment to enable logging
  28.  
  29. error_logfile=error.log
  30.  
  31. ; create debug log as debug.log (defaults to same directory as sendmail.exe)
  32. ; uncomment to enable debugging
  33.  
  34. debug_logfile=debug.log
  35.  
  36. ; if your smtp server requires authentication, modify the following two lines
  37.  
  38. auth_username= mi correo
  39. auth_password= mi password
  40.  
  41. ; if your smtp server uses pop3 before smtp authentication, modify the
  42. ; following three lines.  do not enable unless it is required.
  43.  
  44. ;pop3_server=
  45. ;pop3_username=
  46. ;pop3_password=
  47.  
  48. ; force the sender to always be the following email address
  49. ; this will only affect the "MAIL FROM" command, it won't modify
  50. ; the "From: " header of the message content
  51.  
  52. force_sender=
  53.  
  54. ; force the sender to always be the following email address
  55. ; this will only affect the "RCTP TO" command, it won't modify
  56. ; the "To: " header of the message content
  57.  
  58. force_recipient=
  59.  
  60. ; sendmail will use your hostname and your default_domain in the ehlo/helo
  61. ; smtp greeting.  you can manually set the ehlo/helo name if required
  62.  
  63. hostname=intel.com

pero siempre me sale error el enviar el mensaje, me tiene loco ya, esta es la parte de codigo que contiene el mensaje

Código PHP:
Ver original
  1. <?php
  2.  
  3. $para      = '[email protected]';
  4. $asunto    = 'Prueba de SMTP local';
  5. $mensaje   = 'Mensaje de prueba';
  6. $cabeceras = 'From: [email protected]' . "\r\n" .
  7.              'Reply-To: [email protected]' . "\r\n" .
  8.              'X-Mailer: PHP/' . phpversion();
  9.  
  10.  
  11. if(@mail($para, $asunto, $mensaje, $cabeceras)) {
  12.     echo 'Correo enviado correctamente';
  13. } else {
  14.     echo 'Error al enviar mensaje';
  15. }
  16. ?>

alguna solucion ??? , lei algo sobre mini relay , pero ni idea de como configurar el php.ini para ese programa , gracias
  #2 (permalink)  
Antiguo 04/01/2015, 09:15
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: error envio email

Que error te lanza?
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #3 (permalink)  
Antiguo 04/01/2015, 09:58
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: error envio email

solo me dice mensaje no enviado, no me sale nada mas
  #4 (permalink)  
Antiguo 04/01/2015, 10:05
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: error envio email

probando de otra manera me sale esto
Advertencia: mail (): & quot; sendmail_from & quot; No establezca en php.ini o costumbre & quot; Desde: & quot; encabezado desaparecidos en
  #5 (permalink)  
Antiguo 04/01/2015, 13:19
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: error envio email

nada de nada, ahora lo tengo puesto asi y usando el minirelay
Código PHP:
Ver original
  1. [mail function]
  2. ; For Win32 only.
  3. ; http://php.net/smtp
  4. ;SMTP = smtp.gmail.com
  5. ; http://php.net/smtp-port
  6. ;smtp_port = 25
  7.  
  8. ; For Win32 only.
  9. ; http://php.net/sendmail-from
  10.  sendmail_from = xxxxx@gmail.com                 [B]aqui mi correo[/B]
  11.  
  12. ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
  13. ; http://php.net/sendmail-path
  14.  ;sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"

parece que los manda, pero..... jamas llegan
  #6 (permalink)  
Antiguo 04/01/2015, 14:04
 
Fecha de Ingreso: noviembre-2014
Mensajes: 60
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: error envio email

por fin llego, uffffffffffffff , os pongo el codigo por si a alguien le sirve

Código HTML:
Ver original
  1. <div class="wrap">
  2.             <header>
  3.                 Enviar mail desde localhost con PHP Mailer
  4.             </header>
  5.  
  6.            <section id="principal">
  7.                 <form id="formulario" method="post" action="mail.php" enctype="multipart/form-data">
  8.                     <div class="campos">
  9.                         <label>Para:</label>
  10.                         <input type="email" name="email" required>
  11.                     </div>
  12.                     <div class="campos">
  13.                         <label>Asunto:</label>
  14.                         <input type="text" name="asunto">
  15.                     </div>
  16.                     <div class="campos">
  17.                         <label>Mensaje:</label>
  18.                         <textarea name="mensaje"></textarea>
  19.                     </div>
  20.  
  21.                     <label>Imagen:</label>
  22.                     <input type="file" name="hugo" id="imagen" />
  23.  
  24.                     <input id="submit" type="submit" name="enviar" value="Enviar mail">
  25.                 </form>
  26.  
  27.             </section>
  28.         </div>
  29.     </body>
  30. </html>

php mailer el siguiente

Código PHP:
Ver original
  1. <?php
  2. //Librerías para el envío de mail
  3. include_once('class.phpmailer.php');
  4. include_once('class.smtp.php');
  5.  
  6. //Recibir todos los parámetros del formulario
  7. $para = $_POST['email'];
  8. $asunto = $_POST['asunto'];
  9. $mensaje = $_POST['mensaje'];
  10. $archivo = $_FILES['hugo'];
  11.  
  12. //Este bloque es importante
  13. $mail = new PHPMailer();
  14. $mail->IsSMTP();
  15. $mail->SMTPAuth = true;
  16. $mail->SMTPSecure = "ssl";
  17. $mail->Host = "smtp.gmail.com";
  18. $mail->Port = 465;
  19.  
  20. //Nuestra cuenta
  21. $mail->Username ='@gmail.com'; su correo
  22. $mail->Password = 'xxxx'; //Su password
  23.  
  24. //Agregar destinatario
  25. $mail->AddAddress($para);
  26. $mail->Subject = $asunto;
  27. $mail->Body = $mensaje;
  28. //Para adjuntar archivo
  29. $mail->AddAttachment($archivo['tmp_name'], $archivo['name']);
  30. $mail->MsgHTML($mensaje);
  31.  
  32. //Avisar si fue enviado o no y dirigir al index
  33. if($mail->Send())
  34. {
  35.     echo'<script type="text/javascript">
  36.            alert("Enviado Correctamente");
  37.            window.location="envioemal.php"
  38.         </script>';
  39. }
  40. else{
  41.     echo'<script type="text/javascript">
  42.            alert("NO ENVIADO, intentar de nuevo");
  43.            window.location="envioemal.php"
  44.         </script>';
  45. }
  46. ?>

Etiquetas: email, php, server, ssl
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:31.