Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/04/2015, 21:10
shikamarucb
 
Fecha de Ingreso: febrero-2014
Mensajes: 107
Antigüedad: 10 años, 2 meses
Puntos: 0
Problema con funcion mail y XAMPP

Hola a todos tengo un problema con la funcion mail() de php y xampp; el problema es que no logro hacer que envie correos desde php y ya no se que hacer he probado con las configuraciones que he visto en diferentes foros y nada que doy con el problema.

este es el codigo php
Código PHP:
Ver original
  1. <?php
  2. $destino="[email protected]";
  3. $asunto="correo de prueba";
  4. $mensaje="Este es un correo de prueba HOLA MUNDO";
  5. $encabezados="From: Artemisa IX<[email protected]>";
  6.  
  7. if(mail($destino, $asunto, $mensaje, $encabezados)){
  8.     echo "Mail enviado correctamente";
  9. }else {
  10.     echo "Error al enviar el mail";
  11.     }
  12. ?>

Este es el php.ini

Código Apache:
Ver original
  1. [mail function]
  2. ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
  3. SMTP = smtp.gmail.com
  4. smtp_port = 587
  5.  
  6. ; For Win32 only.
  7. ; http://php.net/sendmail-from
  8. sendmail_from = [email protected]
  9.  
  10. ; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.
  11. ; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.  
  12. ; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
  13. sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
  14.  
  15. ; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder
  16. ;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
  17.  
  18. ; Force the addition of the specified parameters to be passed as extra parameters
  19. ; to the sendmail binary. These parameters will always replace the value of
  20. ; the 5th parameter to mail(), even in safe mode.
  21. ;mail.force_extra_parameters =
  22.  
  23. ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
  24. mail.add_x_header=Off
  25.  
  26. ; Log all mail() calls including the full path of the script, line #, to address and headers
  27. ;mail.log = "C:\xampp\php\logs\php_mail.log"

Este es el sendmail.ini

Código Apache:
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. ; you must change mail.mydomain.com to your smtp server,
  9. ; or to IIS's "pickup" directory.  (generally C:\Inetpub\mailroot\Pickup)
  10. ; emails delivered via IIS's pickup directory cause sendmail to
  11. ; run quicker, but you won't get error messages back to the calling
  12. ; application.
  13.  
  14. smtp_server=smtp.gmail.com
  15.  
  16. ; smtp port (normally 25)
  17.  
  18. smtp_port=587
  19.  
  20. ; SMTPS (SSL) support
  21. ;   auto = use SSL for port 465, otherwise try to use TLS
  22. ;   ssl  = alway use SSL
  23. ;   tls  = always use TLS
  24. ;   none = never try to use SSL
  25.  
  26. smtp_ssl=auto
  27.  
  28. ; the default domain for this server will be read from the registry
  29. ; this will be appended to email addresses when one isn't provided
  30. ; if you want to override the value in the registry, uncomment and modify
  31.  
  32. ;default_domain=mydomain.com
  33.  
  34. ; log smtp errors to error.log (defaults to same directory as sendmail.exe)
  35. ; uncomment to enable logging
  36.  
  37. error_logfile=error.log
  38.  
  39. ; create debug log as debug.log (defaults to same directory as sendmail.exe)
  40. ; uncomment to enable debugging
  41.  
  42. ;debug_logfile=debug.log
  43.  
  44. ; if your smtp server requires authentication, modify the following two lines
  45.  
  46. auth_password=mipass
  47.  
  48. ; if your smtp server uses pop3 before smtp authentication, modify the
  49. ; following three lines.  do not enable unless it is required.
  50.  
  51. pop3_server=
  52. pop3_username=
  53. pop3_password=
  54.  
  55. ; force the sender to always be the following email address
  56. ; this will only affect the "MAIL FROM" command, it won't modify
  57. ; the "From: " header of the message content
  58.  
  59.  
  60. ; force the sender to always be the following email address
  61. ; this will only affect the "RCTP TO" command, it won't modify
  62. ; the "To: " header of the message content
  63.  
  64. force_recipient=
  65.  
  66. ; sendmail will use your hostname and your default_domain in the ehlo/helo
  67. ; smtp greeting.  you can manually set the ehlo/helo name if required
  68.  
  69. hostname=

Ayudenme por favor no se que mas hacer...