sendmail() php xampp localhost Network with proxy

Asked

Viewed 703 times

1

Guys, I would normally send LOCALHOST email using sendmail

mail($to, $assuntoHTML, $mensagemHTML, $headers) 

[sendmail]

 smtp_server=smtp.gmail.com
 smtp_port=587
 error_logfile=error.log
 debug_logfile=debug.log
 smtp_ssl=auto
 [email protected]
 auth_password=minhasenha

 smtp_ssl=tls
 tls_certcheck off

Turns out on the work network, they put a proxy.

I went there and opened the door smtp 587, but I still can’t send more email

Can someone help me to, maybe, enter the proxy information to see if it works ?

Type use proxy 192.1.1.1 port 1234

Thank you very much.

php.ini

[mail function]
SMTP = smtp.gmail.com
smtp_port = 587
sendmail_from = [email protected]
sendmail_path = "C:\"\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header = Off

1 answer

1

Judging by the additional options not present by default in PHP.INI I would say that you are using Fake Sendmail for Windows, correct?

Assuming yes, as part of an answer in SOEN regarding PHP-Mailer, there is no such thing as SMTP proxy, just set the host and the source port which, in Fake Sendmail, appears to be done by configuring the directive hostname in the archive sendmail.ini:

hostname=192.1.1.1:1234

Remember to restart the server after saving the configuration file.

  • I am not using fake, my php.ini looks like this: [mail Function] SMTP = smtp.gmail.com smtp_port = 587 sendmail_from = [email protected] sendmail_path = "C:" xampp sendmail sendmail.exe" -t" mail add_x_header = Off

  • In the directory where your XAMPP has been installed check if there is a subdirectory sendmail and whether there is a file in it sendmail.ini. If not, try adding the directive hostname directly in PHP.INI anywhere within the section [sendmail]

  • Bruno, in sendmail.ini has the code I posted up there, in [sendmail]. I will try to add the hostname and second warning to you as I am not at work now. thank you very much

  • Bruno, I just did the test, sendmail.ini looks like this: [sendmail] hostname=10.190.103.4:3128 smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log debug_logfile=debug.log smtp_ssl=auto [email protected] auth_password=password smtp_ssl=tls tls_certcheck off Did not work.

  • I tried tb in php.ini I tried tb in php.ini [mail Function] SMTP = smtp.gmail.com smtp_port = 587 sendmail_from = [email protected] sendmail_path = "C:" xampp sendmail sendmail.exe" -t" mail.add_x_header = Off hostname=10.190.103.4:3128 Did not work.

  • This sendmail path in PHP.INI is overdone. It should be sendmail_path = "C:\xampp\sendmail\sendmail.exe\ -t". If not, edit the response and add the contents of the log files.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.