Office 365 gives bad sequence error on laravel - laravel

I am trying to user office 365 in my laravel site but for some reason, it does not work and I see the following error in my laravel.log:
[2018-12-04 20:50:59] production.ERROR: Expected response code 354 but got
code "503", with message "503 5.5.1 Bad sequence of commands
" {"exception":"[object] (Swift_TransportException(code: 503): Expected
response code 354 but got code \"503\", with message \"503 5.5.1 Bad
sequence of
commands \" at
/home/forge/owlcrest.co.za/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Tra
nsport/AbstractSmtpTransport.php:457)
[stacktrace]
I am hosting the website with forge.
and all the smtp details are in the .env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=email#odestdf.com.za
MAIL_PASSWORD=fakepasword
MAIL_ENCRYPTION=STARTTLS
I even tried changing the encryption to "tls" but I still see the same error.
Has anyone experienced this before?
EDITED:
Everything was working, but suddenly I see the following error when I see try to send an email:
Expected response code 250 but got code "554", with message "554 5.2.0 STOREDRV.Submission.Exception:SubmissionQuotaE$
" {"exception":"[object] (Swift_TransportException(code: 554): Expected response code 250 but got code \"554\", with message \"554 5.2.0 STOREDRV.Submission.$
\" at /home/forge/owlcrest.co.za/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:457)
Now I am completely confused.

Change the value of MAIL_ENCRYPTION to tls instead of using STARTTLS.
Please also make sure the MAIL_FROM_ADDRESS to your Office365 email address.

Related

Failed to authenticate on SMTP server with username "yea****" using 2 possible authenticators

I'm trying to set up email for a Laravel project using SendGrid.
When following their documentation I get an error (https://sendgrid.com/docs/Integrate/Frameworks/laravel.html)
The .env looks like this
MAIL_DRIVER=smtp
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=yea****
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME="John Smith"
MAIL_FROM_ADDRESS=from#example.com
The error i get looks like this
ErrorException (E_WARNING)
stream_socket_enable_crypto(): Peer certificate CN=`****.****.***' did not match expected CN=`smtp.sendgrid.net'
/home/myusername/public_html/api/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php
public function startTLS()
{
// STREAM_CRYPTO_METHOD_TLS_CLIENT only allow tls1.0 connections (some php versions)
// To support modern tls we allow explicit tls1.0, tls1.1, tls1.2
// Ssl3 and older are not allowed because they are vulnerable
// #TODO make tls arguments configurable
return stream_socket_enable_crypto($this->stream, true, STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
}
Arguments
"stream_socket_enable_crypto(): Peer certificate CN=`****.****.***' did not match expected CN=`smtp.sendgrid.net'"
I fixed this error by using the code provided in this answer (https://stackoverflow.com/a/45315825).
I know this is bad practice but i got another error.
Swift_TransportException
Failed to authenticate on SMTP server with username "yea****" using 2 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535 Incorrect authentication data " in /home/myusername/public_html/a[i/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:456 Stack trace: #0
/home/myusername/public_html/api/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php
$message = 'Failed to authenticate on SMTP server with username "'.$this->username.'" using '.$count.' possible authenticators.';
foreach ($errors as $error) {
$message .= ' Authenticator '.$error[0].' returned '.$error[1].'.';
}
throw new Swift_TransportException($message);
}
}
This looks like some kind of authentication error to me, I am using the same credentials i use to login to the SendGrid dashboard.
any ideas on how to fix these problems?
My solution for this case was double-quote the username, password and port number.
Then I got another error, like this:
'''
Connection to tcp://smtp.hostx.com:465 Timed Out
'''
Connection to tcp://smtp.hostx.com:465 Timed Out
and I fix it changing MAIL_ENCRYPTION from tls to ssl:
MAIL_ENCRYPTION=ssl
I hope this helps someone else due to this post is too old.

Magento worldpay Error ukdc1-pz-cen09:callbackFailureEmail-1312:MerchReq-626-40

I have installed WorldPay Extension and its was working fine but from last few days I face issue. Response URL not call and through fatal error
I got email each time from worldpay and they mentioned they got following error
"
failed CAUSED BY Received fatal
alert: internal_error
Server Reference: ukdc1-pz-cen09:callbackFailureEmail-1312:MerchReq-626-40
"
can one have idea how to solve this?

Where is the laravel error file located? or Is there a default error log in Laravel?

I'm working on a medium project -with laravel- for quite a long time now and of course I use the debugger of the framework -laravel-, but now from time to time I see the page of error but there is just "whoops something went wrong without" without any specifications for the error, and I see it a lot in ajax requests, but I just actualize the page and its gone!;
Finally the error show up again and I could see it in my terminal with the command tail down here
this is what I got
[2016-12-28 14:54:04] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in D:\shop\tess\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:45
Stack trace:
#0 D:\shop\tess\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher(NULL, 'AES-256-CBC')
#1 D:\shop\tess\vendor\laravel\framework\src\Illuminate\Container\Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
I've found this on github it helped https://github.com/orchestral/testbench/issues/93
Make sure APP_DEBUG is set to true in your .env file
You can check the errors with the following command tail -f storage/logs/laravel.log Could be different errors

Error while hosting CodeIgniter Framework to online server

I need to solve the below issue:
When I tried to hosting codeIgniter framework to my online server, this error occurred.
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/lviscomp/public_html/system/core/Output.php:528)
Filename: core/Common.php
Line Number: 573
Backtrace:
A PHP Error was encountered
Severity: Error
Message: XCache: Cannot init
Filename: Unknown
Line Number: 0
Backtrace:
I had the same xcache issue in my Laravel application. I resolved it by upgrading the PHP version.
I think this might help you as well.
Go to your cPanel
Go to software section and click "select PHP version"
Change your PHP version from "native" to 5.4 or 5.5 (It will give you a list of drivers with checkboxes)
Select Xcache and enable it
Save your settings as well as PHP version
I hope it will work.
For Above Error header information already sent...
Click here!
XCache: Cannot init
Try Disable XCACHE from the Php configuration..
if this doesn't work ..
I think this is a question for your host.

Can't Setup Ratchet

I am trying to setup Ratchet on my system and have followed socketo.me
I have done everything till installing ZMQ and React/Zmq and it was all successful.
But when I try to run push-server.php, the following error occurs:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'The provided listener was not a valid callable.' in C:\wamp\www\ratchet\vendor\evenement\evenement\src\Evenement\EventEmitter.php on line 21
InvalidArgumentException: The provided listener was not a valid callable. in C:\wamp\www\ratchet\vendor\evenement\evenement\src\Evenement\EventEmitter.php on line 21
I have already set the PATH variable and enabled the php_zmq extension(I am on Windows using WAMP).
I have searched a lot but can't get through this problem, please help.
What have you done ?
You have changed the event to be called
$pull->on('message', array($pusher, 'onBlogEntry'));
you have changed the onBlogEntry with a function that you didn't declare in your pusher ..
that's it

Resources