fwrite(): send of 6 bytes failed with errno=32 Broken pipe laravel - 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.

Related

Send outlook email through proxy server in 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}

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.

Websocket is not working with SSL

https://www.hi-todd.com/websocket/
I have created one demo with MQTT protocol and it is working fine with HTTP connection. But when I tried to change HTTP to https then it is getting a connection error.
I have added certificate path in mosquitto.conf file. Let me share with you Mosquitto config path.
# WebSockets over TLS/SSL
listener 8083
protocol websockets
cafile /etc/mosquitto/ca_certificates/ca.crt
certfile /etc/mosquitto/ca_certificates/hi-todd_com.crt
keyfile /etc/mosquitto/ca_certificates/hi-todd_com.p7b
I have used below library code.
https://www.cloudmqtt.com/docs-websocket.html
Now we've fixed all the other issues.
The certificate you are using has a CN of hi-todd.com and has alternate CNs of
DNS:hi-todd.com, DNS:www.hi-todd.com
This means it's only valid for those hosts. In your config.js you are referencing the host by it's IP address so it will not match the certificate. This will cause the browser to reject the connection as insecure.
To fix this make your config.js use the hostname not the ip address.

Sending Mail With Plesk Server

I made an application who send many emails for different actions, i tested with Mailtrap.io. Everything is going well with this test service but when i tried to migrate the the real smtp from my domain. Nothing happen.
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mydomain.eu
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
When i put MAIL_PORT = 25 i have no exception but any mails is send. When i put the port 565 i get
Connection could not be established with host
smtp.mydomain.eu [Connection refused #111]
If i put the username and password from the mail adresse i configured in the plesk it's change nothing.
The serveur use SSH maybe the error comes from this ?
Hope someone could help me .. thanks a lot in advance.
port "565" ? Pls. make sure, that the actual used port in your script is actually the one you would like to connect to!
#25 smtp (TCP)
#110 pop3 (TCP)
#143 imap (TCP)
#465 smtps (TCP)
#993 imaps (TCP)
#995 pop3s (TCP)
AND
#587 mail message submission (TCP)
It is port 587 with ssl encryption,
But you must active port 587 in your plesk domein.
You must check the option "Enable SMTP on port 587 for all IP addresses" Then you can send mail from port 587.
The check option is location in your default mail settings, not your domein settings.

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

Resources