Unable to send emails

Morning all,

I have managed to get rid of the some of the initial errors I was getting running and am trying to register a new user (using /api/v2/user/register) but keep running into an issue I have narrowed down to be an issue with Dreamfactory sending emails.

The error I get is:

error processing user confirmation. Expected response code 220 but got code “500” with message "500 5.5.1 Invalid command: “”

I’ve checked the SMTP settings are correct in the .env file and am able to send emails using these smtp settings from other .php files on the same server (server is running Ubuntu 15.04).

Any suggestions on what I can try ( using dreamfactory 2.0.1)

  • I’ve also just tried moving from my SMTP server to gmail server with the same error (initially got username and password not accepted but changed the port and sorted that)

Go to Services, User, Config
and check to make sure that the open registration email service is set to the service you wish to use.
Then you should attempt to use the API (in API Docs) to send a test email with your email service of choice.

Thanks Drew

Still no luck. I get error (using my own smtp and gmail):

{
“error”: {
“context”: null,
“message”: “Expected response code 220 but got code "", with message ""”,
“code”: 500,
“trace”: [
“0 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(289): Swift_Transport_AbstractSmtpTransport->_assertResponseCode(‘’, Array)”,
“1 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(117): Swift_Transport_AbstractSmtpTransport->_readGreeting()”,
“2 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start()”,
“3 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(395): Swift_Mailer->send(Object(Swift_Message), Array)”,
“4 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(181): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message))”,
“5 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Services/Email/BaseService.php(197): Illuminate\Mail\Mailer->send(Array, Array, Object(Closure))”,
“6 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Services/Email/BaseService.php(112): DreamFactory\Core\Services\Email\BaseService->sendEmail(Array, ‘test’, NULL)”,
“7 [internal function]: DreamFactory\Core\Services\Email\BaseService->handlePOST()”,
“8 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(271): call_user_func(Array)”,
“9 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Components/RestHandler.php(177): DreamFactory\Core\Components\RestHandler->processRequest()”,
“10 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Services/BaseRestService.php(65): DreamFactory\Core\Components\RestHandler->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), NULL)”,
“11 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/dreamfactory/df-core/src/Utility/ServiceHandler.php(57): DreamFactory\Core\Services\BaseRestService->handleRequest(Object(DreamFactory\Core\Utility\ServiceRequest), NULL)”,
“12 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17588): DreamFactory\Core\Utility\ServiceHandler::processRequest(‘v2’, ‘email’, NULL)”,
“13 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17564): DreamFactory\Http\Controllers\RestController->handleService(‘v2’, ‘email’, NULL)”,
“14 [internal function]: DreamFactory\Http\Controllers\RestController->handlePOST(‘v2’, ‘email’)”,
“15 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8842): call_user_func_array(Array, Array)”,
“16 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8911): Illuminate\Routing\Controller->callAction(‘handlePOST’, Array)”,
“17 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8891): Illuminate\Routing\ControllerDispatcher->call(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route), ‘handlePOST’)”,
“18 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))”,
“19 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“20 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17848): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“21 [internal function]: DreamFactory\Http\Middleware\AccessCheck->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“22 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“23 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“24 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“25 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8892): Illuminate\Pipeline\Pipeline->then(Object(Closure))”,
“26 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(8877): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(DreamFactory\Http\Controllers\RestController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘handlePOST’)”,
“27 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7831): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘DreamFactory\\Ht…’, ‘handlePOST’)”,
“28 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7802): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request))”,
“29 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7455): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))”,
“30 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))”,
“31 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“32 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“33 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“34 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7456): Illuminate\Pipeline\Pipeline->then(Object(Closure))”,
“35 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7444): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))”,
“36 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(7429): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))”,
“37 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2304): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))”,
“38 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))”,
“39 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9553): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“40 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/vendor/barryvdh/laravel-cors/src/HandleCors.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“41 [internal function]: Barryvdh\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“42 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“43 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(17932): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“44 [internal function]: DreamFactory\Http\Middleware\FirstUserCheck->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“45 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“46 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12881): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“47 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“48 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“49 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(11504): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“50 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“51 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“52 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12622): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“53 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“54 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“55 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(12561): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“56 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“57 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“58 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2978): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“59 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))”,
“60 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9545): call_user_func_array(Array, Array)”,
“61 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))”,
“62 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(9535): call_user_func(Object(Closure), Object(Illuminate\Http\Request))”,
“63 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2251): Illuminate\Pipeline\Pipeline->then(Object(Closure))”,
“64 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/bootstrap/cache/compiled.php(2234): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))”,
“65 /opt/dreamfactory-2.0.1-0/apps/dreamfactory/htdocs/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))”,
“66 {main}”
]
}
}

You said you’re editing this mail service in the .env file? I suppose that was configured via the Bitnami GUI installer?
Have you tried just adding an email service to the API (under Services) and using it instead? Just trying to narrow down the issue.

Hi Drew

I’ve added a new email server (smtp) via the Services menu and pointed this to the Gmail settings and get the same error as above.

For now I have disabled emails in DF so that user registration works ok (the confirmation email was failing due to the above error).

Its a strange issue, and one others don’t seem to experience.

To test, I have reinstalled a fresh install of DF 2.0.1 on my Ubuntu virtual server via Bitnami and am getting exactly the same issue

Gavin

Gavin, I’m going to redo some testing of this component and get back to you.

1 Like

Can’t replicate the issue.
Can you share your config on your email service? [don’t include the password =)]