Comments (9)
This sounds like your corporate network maybe filtering/blocking connections to Mailgun. Can you try opening your browser and going to https://api.mailgun.net/v3/example.com/messages you should see a 405 Method Not Allowed.
from cakephp-mailgun.
Yes, I see that. What does it mean?
from cakephp-mailgun.
Are you connected to the corporate network or a different network?
from cakephp-mailgun.
I'm connected to the corporate network right now.
from cakephp-mailgun.
@peiblox Please check your error logs for more details - logs/error.log
and logs/debug.log
.
Also to make sure http calls using curl are working, try to run following code from anywhere in your application e.g. controller's action.
use Cake\Http\Client;
$http = new Client();
$response = $http->post("https://api.mailgun.net/v3/example.com/messages", '', [
'auth' => ['username' => 'api', 'password' => 'password']
]);
debug($response->getJson());
Replace example.com
with your domain name and password
with your api key.
This might give you a better idea on what is going on while making an HTTP request via curl and cake's HTTP client.
from cakephp-mailgun.
Hi,
I've just tried what you said and the error log is pretty much showing the same results as the screenshot I posted before.
Here is the error using the plugin.
2019-07-25 09:41:32 Error: [Cake\Http\Exception\HttpException] cURL Error (28) Resolving timed out after 30070 milliseconds
#0 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(445): Cake\Http\Client\Adapter\Curl->send(Object(Cake\Http\Client\Request), Array)
#1 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(414): Cake\Http\Client->_sendRequest(Object(Cake\Http\Client\Request), Array)
#2 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(381): Cake\Http\Client->send(Object(Cake\Http\Client\Request), Array)
#3 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(264): Cake\Http\Client->_doRequest('POST', 'https://api.mai...', '--3974ada5d4dd7...', Array)
#4 /my-project/vendor/narendravaghela/cakephp-mailgun/src/Mailer/Transport/MailgunTransport.php(380): Cake\Http\Client->post('https://api.mai...', '--3974ada5d4dd7...', Array)
#5 /my-project/vendor/narendravaghela/cakephp-mailgun/src/Mailer/Transport/MailgunTransport.php(156): Mailgun\Mailer\Transport\MailgunTransport->_sendEmail()
#6 /my-project/vendor/cakephp/debug_kit/src/Mailer/Transport/DebugKitTransport.php(79): Mailgun\Mailer\Transport\MailgunTransport->send(Object(Mailgun\Mailer\MailgunEmail))
#7 /my-project/vendor/cakephp/cakephp/src/Mailer/Email.php(2140): DebugKit\Mailer\Transport\DebugKitTransport->send(Object(Mailgun\Mailer\MailgunEmail))
#8 /my-project/vendor/cakephp/cakephp/src/Mailer/Mailer.php(308): Cake\Mailer\Email->send()
#9 /my-project/plugins/Neo/FormsManager/src/Controller/FormsController.php(223): Cake\Mailer\Mailer->send('submit', Array)
#10 /my-project/vendor/cakephp/cakephp/src/Controller/Controller.php(610): Neo\FormsManager\Controller\FormsController->edit('1')
#11 /my-project/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(120): Cake\Controller\Controller->invokeAction()
#12 /my-project/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(94): Cake\Http\ActionDispatcher->_invoke(Object(Neo\FormsManager\Controller\FormsController))
#13 /my-project/vendor/cakephp/cakephp/src/Http/BaseApplication.php(235): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#14 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Http\BaseApplication->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#15 /my-project/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php(162): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#16 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\RoutingMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#17 /my-project/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php(88): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#18 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\AssetMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#19 /my-project/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php(96): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#20 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Error\Middleware\ErrorHandlerMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#21 /my-project/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php(53): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#22 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): DebugKit\Middleware\DebugKitMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#23 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(51): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#24 /my-project/vendor/cakephp/cakephp/src/Http/Server.php(98): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#25 /my-project/webroot/index.php(40): Cake\Http\Server->run()
#26 {main}
Request URL: /forms-manager/forms/edit/1
Referer URL: http://localhost/my-project/forms-manager/forms
Here is the error using the HTTP Client directly:
2019-07-25 09:44:43 Error: [Cake\Http\Exception\HttpException] cURL Error (28) Resolving timed out after 30064 milliseconds
#0 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(445): Cake\Http\Client\Adapter\Curl->send(Object(Cake\Http\Client\Request), Array)
#1 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(414): Cake\Http\Client->_sendRequest(Object(Cake\Http\Client\Request), Array)
#2 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(381): Cake\Http\Client->send(Object(Cake\Http\Client\Request), Array)
#3 /my-project/vendor/cakephp/cakephp/src/Http/Client.php(264): Cake\Http\Client->_doRequest('POST', 'https://api.mai...', '', Array)
#4 /my-project/plugins/Neo/FormsManager/src/Controller/FormsController.php(215): Cake\Http\Client->post('https://api.mai...', '', Array)
#5 /my-project/vendor/cakephp/cakephp/src/Controller/Controller.php(610): Neo\FormsManager\Controller\FormsController->edit('1')
#6 /my-project/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(120): Cake\Controller\Controller->invokeAction()
#7 /my-project/vendor/cakephp/cakephp/src/Http/ActionDispatcher.php(94): Cake\Http\ActionDispatcher->_invoke(Object(Neo\FormsManager\Controller\FormsController))
#8 /my-project/vendor/cakephp/cakephp/src/Http/BaseApplication.php(235): Cake\Http\ActionDispatcher->dispatch(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#9 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Http\BaseApplication->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#10 /my-project/vendor/cakephp/cakephp/src/Routing/Middleware/RoutingMiddleware.php(162): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#11 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\RoutingMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#12 /my-project/vendor/cakephp/cakephp/src/Routing/Middleware/AssetMiddleware.php(88): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#13 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Routing\Middleware\AssetMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#14 /my-project/vendor/cakephp/cakephp/src/Error/Middleware/ErrorHandlerMiddleware.php(96): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#15 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): Cake\Error\Middleware\ErrorHandlerMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#16 /my-project/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php(53): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#17 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(65): DebugKit\Middleware\DebugKitMiddleware->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response), Object(Cake\Http\Runner))
#18 /my-project/vendor/cakephp/cakephp/src/Http/Runner.php(51): Cake\Http\Runner->__invoke(Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#19 /my-project/vendor/cakephp/cakephp/src/Http/Server.php(98): Cake\Http\Runner->run(Object(Cake\Http\MiddlewareQueue), Object(Cake\Http\ServerRequest), Object(Cake\Http\Response))
#20 /my-project/webroot/index.php(40): Cake\Http\Server->run()
#21 {main}
Request URL: /forms-manager/forms/edit/1
Referer URL: http://localhost/my-project/forms-manager/forms
I'm using cURL in other parts of my app to connect to other services and I'm not having any issue, so I don't think it's a cURL problem itself.
For any reason, is only happening with the Mailgun API and my Mac connected to the corporate network.
Thank you both for your help.
from cakephp-mailgun.
Did you ever resolve this?
from cakephp-mailgun.
I've doing some tests but couldn't resolve this.
I had the same issue with the official mailgun-php library, but reinstalling using the recommended libraries solved the problem. I was using the php-http/guzzle6-adapter library. Removing that resolved the problem with mailgun-php library.
However, the error remains the same with de cakephp-mailgun library and I wasn't able to figure out why it keeps happening.
Do you know if I can use another libraries to connect the cakephp-mailgun library with the Mailgun API?
Thanks!
from cakephp-mailgun.
Hmm thats strange, we haven't heard of anyone else having the issue. You could just use the built in HttpClient that CakePHP provides. Sorry we couldn't help out with your issue.
from cakephp-mailgun.
Related Issues (19)
- BCC HOT 3
- Token HOT 4
- plugin doesn't send attachments HOT 1
- Unknown email configuration "mailgun". HOT 4
- i am facing this issue HOT 2
- Transport class "mailgun" not found. HOT 2
- How to use inline attachments? HOT 5
- Deprecated warnings in CakePHP 3.6 HOT 1
- Issue when sending emails with attachments in 1.0.6 HOT 5
- Mailgun\Tests\Mock\Mailgun is not available on mailgun-php after version 2.1 HOT 2
- Mailgun EU Support is missing. HOT 3
- CakePHP 3.7 deprecations HOT 1
- Class 'App\Controller\MailgunEmail' not found HOT 1
- Use MailgunEmail features in Mailers HOT 4
- making use of the status codes when there are errors returned from Mailgun HOT 4
- Upgrade for CakePHP 4.x HOT 1
- Domain HOT 2
- Sending emails in a loop causing _formData to persist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakephp-mailgun.