mail fake configurar email smtp gmail xampp

email - fake - XAMPP Sendmail usando la cuenta de Gmail



sendmail xampp (9)

Bueno, hoy, la mejor respuesta no funcionó para mí. Pero, esto hizo:

en sendmail.ini :

[sendmail] smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log debug_logfile=debug.log auth_username=****@gmail.com auth_password=******* force_sender=****@gmail.com

en php.ini:

[mail function] sendmail_path = "/"C:/xampp/sendmail/sendmail.exe/" -t"

Basado en port @: http://support.google.com/mail/bin/answer.py?hl=en&answer=13287

Estoy tratando de configurar Sendmail a través de XAMPP para enviar correo electrónico. En mi sendmail.ini tengo estos ajustes:

# Set default values for all following accounts. logfile "C:/xampp/sendmail/sendmail.log account Gmail tls on port 587 tls_certcheck off host smtp.gmail.com from [email protected] auth on user [email protected] password mypassword account default : Gmail

He creado un script de prueba como este:

$to = "[email protected]"; $subject = "Hi!"; $body = "Hi,/n/nHow are you?"; $headers = "From: [email protected]" . "/r/n"; if (mail($to, $subject, $body, $headers)) { echo ("Message successfully sent!"); } else { echo ("Message delivery failed..."); }

Recibo un mensaje para decir que el correo electrónico fue enviado pero nunca llega y en los registros que obtengo:

sendmail: Error durante la entrega: primero debe emitir un comando STARTTLS.

¿Alguien sabe cuál podría ser el problema aquí?

¡Gracias por adelantado!

Gaz


Esto es lo que funcionó para mí. Espero que nadie más queme petróleo para resolver esto como lo hice yo.

Aquí está mi sendmail.ini

[sendmail] smtp_server=smtp.gmail.com smtp_port=25 error_logfile=error.log debug_logfile=debug.log [email protected] auth_password=yourgmailpassword [email protected]

php / php.ini ---- básicamente comenta todo, excepto sendmail_path & mail.add_x_header

[mail function] ; For Win32 only. ; http://php.net/smtp ;SMTP = localhost ; http://php.net/smtp-port ;smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = postmaster@localhost ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "/"C:/xampp/sendmail/sendmail.exe/" -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = Off ; Log all mail() calls including the full path of the script, line #, to address and headers ;mail.log = "C:/xampp/apache/logs/php_mail.log"

Esto me funcionó después de actualizar los archivos de sendmail (los antiguos no admiten smtp)

  • vaya a homepage y obtenga el último archivo zip de sendmail
  • descomprima el escritorio y copie los archivos en su carpeta / xampp / sendmail reemplazando todo lo que estaba allí. ¡TODO!
  • Ahora abre sendmail.ini y copia lo que mostré arriba (¡elimina todo lo que hay en ese archivo primero o simplemente comenta todo!)
  • NOTA: no necesita que se inicien los servidores de Mercury para esto.

Estaba haciendo un php de recuperación de contraseña en localhost cuando encontré este problema. Necesitaba enviar a los usuarios su contraseña. - tu php parece okey


Estos son los requisitos más recientes del servidor SMTP de Google:

  1. Dirección del servidor SMTP de Gmail: smtp.gmail.com
  2. Contraseña de Gmail SMTP: (Su contraseña de Gmail)
  3. Puerto SMTP de Gmail (TLS): 587
  4. Puerto SMTP de Gmail (SSL): 465
  5. Gmail SMTP TLS / SSL requerido:

Requisitos de SMTP de Google

Si solo usas SSL, se complica con la prueba de verificación Captcha requerida, así que simplemente configuro mi SSL en automático, que probará TLS cuando falla el SSL.


Hay otro problema al usar Gmail. Gmail ahora tiene seguridad, por lo que debe generar una contraseña específica de la aplicación; no puede usar la contraseña que tiene para su acceso normal a Gmail. Descubrí esto al probar los ejemplos anteriores y luego noté que en la carpeta sendmail se había generado un registro de errores. En el registro de errores me encontré con un mensaje que indica esto.



Solo para añadir a las ya grandes respuestas. Asegúrese de que está ejecutando XAMPP como administrador. Eso fue lo que me lo arregló.



a) Cambiar php.ini Localice php.ini en la ruta del archivo "[Letra de unidad]: [Directorio XAMPP] / php". por ejemplo, C: / xampp / php / php.ini

Busque sendmail_path en su archivo php.ini y elimine el punto y coma “;” antes de que [el mío no tuviera ruta].

[mail function] ; For Win32 only. SMTP = smtp.gmail.com smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = [your_gmail_username]@gmail.com sendmail_path = "/"C:/xampplite/sendmail/sendmail.exe/" -t"

b) Cambiar sendmail.ini. La ubicación de sendmail.ini en la ruta del archivo es "[Letra de unidad]: [Directorio XAMPP] / sendmail", por ejemplo, C: / xampp / sendmail / sendmail.ini

Comente los contenidos de "Mercury" y "Un ejemplo de servicio de correo gratuito" como se muestra a continuación:

# Mercury <br/> #account Mercury <br/> #host localhost <br/> #from postmaster@localhost <br/> #auth off <br/> # A freemail service example <br/> #account Hotmail <br/> #tls on <br/> #tls_certcheck off <br/> #host smtp.live .com <br/> #from [exampleuser]@hotmail.com <br/> #auth on <br/> #user [exampleuser]@hotmail .com <br/> #password [examplepassword] <br/>

do. Agrega la cuenta de gmail.

Ejemplo:

account Gmail tls on tls_certcheck off host smtp.gmail.com from [your_gmail_username]@gmail.com auth on account default : Gmail

re. Reinicie el servidor apache

No utilicé gmail. Utilicé mi cuenta de hosting. Si lo haces, asegúrate de que la configuración de SMTP sea correcta. El mío fue mail.abc.com no smtp.gmail.com. Este código es de 2 sitios web. Necesitas cambiar ambos archivos. Lo tengo funcionando en Xampp 1.73 corriendo en una caja de win200sp4. Todos los ajustes por defecto excepto estos dos archivos. php.ini y sendmail.ini


THIS IS WHAT YOU SENDMAIL SHOULD LOOK LIKE [sendmail] ; you must change mail.mydomain.com to your smtp server, ; or to IIS''s "pickup" directory. (generally C:/Inetpub/mailroot/Pickup) ; emails delivered via IIS''s pickup directory cause sendmail to ; run quicker, but you won''t get error messages back to the calling ; application. smtp_server=smtp.gmail.com ; smtp port (normally 25) smtp_port=465 ; SMTPS (SSL) support ; auto = use SSL for port 465, otherwise try to use TLS ; ssl = always use SSL ; tls = always use TLS ; none = never try to use SSL smtp_ssl=auto ; the default domain for this server will be read from the registry ; this will be appended to email addresses when one isn''t provided ; if you want to override the value in the registry, uncomment and modify ;default_domain=mydomain.com ; log smtp errors to error.log (defaults to same directory as sendmail.exe) ; uncomment to enable logging error_logfile=error.log ; create debug log as debug.log (defaults to same directory as sendmail.exe) ; uncomment to enable debugging debug_logfile=debug.log ; if your smtp server requires authentication, modify the following two lines auth_username=Your Email Here auth_password=Your Password Here ; if your smtp server uses pop3 before smtp authentication, modify the ; following three lines. do not enable unless it is required. pop3_server= pop3_username= pop3_password= ; force the sender to always be the following email address ; this will only affect the "MAIL FROM" command, it won''t modify ; the "From: " header of the message content force_sender=Your Email Here ; force the sender to always be the following email address ; this will only affect the "RCTP TO" command, it won''t modify ; the "To: " header of the message content force_recipient= ; sendmail will use your hostname and your default_domain in the ehlo/helo ; smtp greeting. you can manually set the ehlo/helo name if required hostname=smtp.gmail.com THIS IS WHAT YOU PHP.INI FILE SHOULD LOOK LIKE [mail function] ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury smtp_server=smtp.gmail.com smtp_port = 465 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = postmaster@localhost ; 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. ; 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. ; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder) sendmail_path = "/"C:/xampp/sendmail/sendmail.exe/" -t" ; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:/xampp/mailoutput folder ;sendmail_path = "C:/xampp/mailtodisk/mailtodisk.exe" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header=Off