Hey @david and everyone, I have successfully setup & everything else is working well on my V5 white Label Self Hosted except that i cannot Send Emails at all including Customer Quotes & Invoices but most importantly invitation emails to newly added Admin Users & Clients.
Whenever i try to contact support by clicking the black envelope on the bottom left corner, i get a 500: Server Error.
I SUSPECT IT HAS TO DO WITH MY ENV MAIL ENTRY via cPanel AS SHOWN BELOW:
Please tell me if i did it correctly, AND IM CONCERNED ABOUT WHERE TO PUT THE âBRACKETSâ AND WHERE NOT TO PUT THEM, i thought maybe thatâs what is causing the emails not to send.
Good day i have gone through the log as you have said and i do not know what to look at as there is a lot of info, however i checked on todays date and these are a couple of the top lines for today:
[2021-11-12 06:06:06] production.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) {âuserIdâ:1,âexceptionâ:"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) at /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)
[stacktrace] #0 [internal function]: Swift_Transport_StreamBuffer->{closure}(2, âstream_socket_câŚâ, â/home/websiter/âŚâ, 264, Array) #1 /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(264): stream_socket_client(âssl://smtp.gmaiâŚâ, 101, âNetwork is unreâŚâ, 30, 4, Resource id #921) #2 /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishSocketConnection() #3 /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize(Array) #4 /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(65): Swift_Transport_AbstractSmtpTransport->start() #5 /home/websiter/public_html/portal/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(521): Swift_Mailer->send(Object(Swift_Message), Array) #6 /home/websiter/public_html/portal/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(288): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message)) #7 /home/websiter/public_html/portal/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(187): Illuminate\Mail\Mailer->send(âemail.support.mâŚâ, Array, Object(Closure)) #8 /home/websiter/public_html/portal/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\Mail\Mailable->Illuminate\Mail\{closure}()
Hey @david i have changed my email from the Gmail i had put before to my own Domain email, Because when i checked the LOGS i noticed this line:
[2021-11-12 08:14:00] production.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) {âuserIdâ:1,âexceptionâ:"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) at /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)
[stacktrace]
HERE ARE MY NEW MAIL SETTINGS IN THE ENV FILE
HERE IS HOW I PUT IT
MAIL_MAILER=smtp
MAIL_HOST=mail.mydomain.co.za
MAIL_PORT=465
MAIL_USERNAME=â[email protected]â
MAIL_PASSWORD=â123456789â
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=â[email protected]â
MAIL_FROM_NAME=âMy Domainâ
Important Question: AFTER MAKING THESE CHANGES VIA CPANEL, HOW DO I APPLY THE CHANGES JUST LIKE WHAT RUNNING php artisan optimize DOES FOR THE HOSTED V5s
LAST QUESTION: Im concerned about this line in the ENV file: MAIL_MAILER=smtp
since im using my own domain does this
Good day @david I Just wanted to thank you for your kind responces and also update you and every1 on my current progress.
(1) i did not change the PORT NUMBER as my configuration is not for gmail but for my own domain.
(2) WHER EXACTLY DO I RUN THE COMAND: UPDATE_SECRET=secret DO I DO IT IN cPanel or do i have to input my installation address before this?: UPDATE_SECRET=secret
MY EMAILS ARE FINALLY SENDING STARTING TODAY 15 NOV 2021
im not sure what was the solution yet because i made at least 3 changes at the same time before it worked.
i now know for a fact that whenever i edit the ENV file via cPanel, i must wait for the next morning before my changes are applied.
SO THESE ARE THE CHANGES AND MY REASONS:
(Change 1) at first when I edited the env file I was using my personal Gmail email address and password which was different from the email address Iâm using to login to the invoice ninja platform, so when I got help and got confirmation that there was nothing wrong with my Gmail email settings on the env file edit that I had made, hi there thought to myself why itâs not working and this thought came to my mind⌠WHAT IF MY LOGIN DETAILS MUST BE THE SAME AS THE EMAIL & PASSWORD SETTINGS I PUT IN THE ENV FILE? so I went ahead and made changes to match them.
(Change 2) Iâm using my own domain name which goes like [mydomain.co.za] therefore my email address is [[email protected]] and my cpanel recommended outgoing mail server settings for both SSL and TLS are:
MAIL HOST = [mail.mydomain.co.za]
MAIL PORT= 465 for SSL/TLS
previously I had put TLS and it didnât work so I just went ahead to switch the MAIL_ENCRYPTION to SSL.
THIS IS THE A LOG ENTRY ON NOV 13:
[2021-11-13 10:08:05] production.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) {âuserIdâ:1,âexceptionâ:"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Network is unreachable) at /home/websiter/public_html/portal/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)
[stacktrace]
And if you get an error, try making the username and password wrong and see if you get a different error.
Try using TLS and port 587 instead.
And after that if you get a ErrorException stream_socket_enable_crypto(): Peer certificate CN= error then disable SMTP Restrictions in WHM.
@NZNinja thank you so much from Johannesburg
about this: yourdomain.com/public/UPDATE_SECRET=secret
you must know that my invoice ninja installation is on a subdirectory at OR i login at:
mydomain.co.za/portal/public
and my clients login at:
mydomain.co.za/portal/public/client
SO TO REFRESH CORRECTLY DO I PUT IT LIKE THIS?
mydomain.co.za/portal/public/UPDATE_SECRET=secret
I ASK BCAUSE I TRIED THIS WAY:
mydomain.co.za/public/UPDATE_SECRET=secret
and it says Oops! That page canât be found
Thank you again for this input,
I tried my Gmail settings exactly as you have instructed and @david even checked & confirmed that they were correct, i then abandoned the Gmail and used my domain email and it only worked when i replaced TLS with SSL.
ONE THING I HAVE LEARNED AFTER YOUR RESPONCE:
i was initially under the impression that my clients will see that the emails were sent from a Gmail account, which i did not want to happen, upon checking i learned that in Invoice Ninja under SETTINGS, under EMAIL SETTINGS i can input the email that i need under REPLY-TO EMAIL, this will show it in my clients inbox as the sending email and also as my clientsâ reply to email.
NEVERTHELESS:
i am using my domain email as the sending email and it is working 100% and these are the settings just in case others wanna try it: