Send outlook email through proxy server in Laravel - laravel

How can I send an outlook email through a proxy server?
I am working for a company on a project, and I want my laravel project able to send the email. But, the company is protected by a proxy server and whenever I want to send email, I will get below kind of error:
Connection could not be established with host smtp.mailtrap.io >:stream_socket_client(): unable to connect to tcp://smtp.mailtrap.io:2525 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
my .env file:
MAIL_MAILER=smtp
MAIL_HOST={proxy_address}
MAIL_PORT=587
MAIL_USERNAME=*******#{Company_domain}.com
MAIL_PASSWORD=***************
MAIL_ENCRYPTION=''
HTTPS_PROXY = {proxy_name}:{proxy_password}#{proxy_address}:{port}

Related

problem in connecting client to L2TP server

I've the MIKROTIK router on KVM. after transfer MIKROTIK to new server and change the router IP my client can not connect to the server. and in the server log file show me this error: phase1 negotiation failed due to time up XX.XX.XX.XX[500]<=>XX.XX.XX.XX[500] 3f80f907708fbe3a:4a3ab01f25adc16f
can help me to fix this.

fwrite(): send of 6 bytes failed with errno=32 Broken pipe laravel

when i am using smtp without ssl it giving this error
MAIL_DRIVER=smtp
MAIL_HOST=mail.onestopdigitalagency.com
MAIL_PORT=587
MAIL_USERNAME=thankyou#onestopdigitalagency.com
MAIL_PASSWORD=********
MAIL_ENCRYPTION=
a month ago it was workig fine
and if I use this it send email but not to gmail
MAIL_DRIVER=smtp
MAIL_HOST=mail.onestopdigitalagency.com
MAIL_PORT=465
MAIL_USERNAME=thankyou#onestopdigitalagency.com
MAIL_PASSWORD=********
MAIL_ENCRYPTION=ssl
and on tls setting it giving timeout error
I recently ran into this problem with an email provider that upgraded their services to have tighter TLS security requirements. The error was the result of the remote connection being forced closed. In your case, you were not using encryption and it was working fine, but now they are requiring encryption and their SMTP server is closing the connection.
You could also use the tls setting if you change the port to 587. Port 465 is SSL, TLS is used with ports 25 or 587.

Connection could not be established with host laravel 5.4?

i am using virtual host but phpmyadmin is also pointed to virtual host ip and working perfectly
when i register a account on my laravel project i am getting following error .
Connection could not be established with host [No connection could be
made because the target machine actively refused it.
#10061]
in my logs
#10061] in C:\xampp\htdocs\upload\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php:268
Stack trace:
This error can be caused by having the wrong values configured for MAIL_PORT, MAIL_ENCRYPTION, and occasionally MAIL_HOST.
swiftmailer is the library that sends email. You're getting the error when you register and Laravel tries to send an email.
"...the target machine actively refused..." means that the host resolved successfully, but the other computer either has a firewall blocking the port or no process is listening on that port.
Your mailer service should tell you what port to use in their documentation. If using MAIL_DRIVER=smtp and MAIL_ENCRYPTION=tls, typically this will be port 587, 465, or 25.

Sending email from Laravel using Gmail

I have been using Laravel for a little while now, so thought I would dive into HTML emails, so I followed a tutorial.
The issue I have, as well as seemingly quite a few others is this:
Swift_TransportException in StreamBuffer.php line 269:
Connection could not be established with host smtp.gmail.com
[A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host has failed to respond.
#10060]
My .ENV
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=EMAIL
MAIL_PASSWORD=PASS
MAIL_ENCRYPTION=tls
I have also tried ports 25 and others suggested, as well as ssl as opposed to tls, I have also tried using sendmail as opposed to smtp.
Further to this, I have the same issue when trying with an Outlook account.
I even enabled the option to accept items from less secure applications.
Anyone else experiencing these issues?
UPDATE:
I am having the same issues with Mail Trap, could it be my laravel install?
Also tried with a fresh install...
FURTHER UPDATE
When I ping any site, I get request timed out, which means I think my router is blocking me?
According with help for administrator page of Google, when you try to connect by port 465 this requires encryption SSL, on the contrary if you use TLS you should set the port to 587, try changing the port on your .env file.
Reference: https://support.google.com/a/answer/176600?hl=es
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=youremailaddress
MAIL_PASSWORD=yourownpassword
MAIL_ENCRYPTION=tls

CodeIgniter email class behind proxy server

Email class in codeigniter is awesome but not if you are behind proxy server. I just make a mechanism to send an email to someone through my reservation application with codeigniter. I test it in my local machine with localhost address and it works. But when i move my code to different machine with some reverse proxy working, it is fail to send. I get some error message as below
A PHP Error was encountered
Severity: Warning
Message: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (No connection could be made because the target machine actively refused it. )
Filename: libraries/myemail.php
Line Number: 29
Just remember that i can send the email before, with localhost address. I implement this for creating connection through proxy server in my college. Any suggestion?

Resources