Dies kann nicht ein Problem mit MailGun senden, da ich nicht in der Lage war, über Gmail als gut zu senden.Laravel wird nicht meine Domäne an den MailGun Fahrer passieren, so kann ich nicht mail
Der Fehler, den ich bekomme, wie unten zu sehen ist, können Sie sehen, wo die Domain übergeben werden sollte, hat aber nicht.
POST https://api.mailgun.net/v3//messages.mime
sollte die Domain
POST https://api.mailgun.net/v3/domin/messages.mime
sein Ich weiß, ich habe Guzzle installiert ist, ich auf den Webserver angepasst haben und ich weiß, dass meine Daten korrekt sind. Ich habe ein Testprojekt erstellt, um nur noch Mail zu versenden, ohne Erfolg.
Könnte es etwas todo mit meinem Host-Computer (macbook air) oder diese Tatsache sein, ich bin mit der Entwicklung Web-Server
php artisan serve
Ich bin neu zu Laravel so bin ich von etwas unsicher sonst kann ich tun.
services.php
'mailgun' => [
'domain' => env('sandbox*****.mailgun.org'),
'secret' => env('key-**************'),
],
mail.php
'driver' => env('MAIL_DRIVER', 'mailgun'),
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'port' => env('MAIL_PORT', 587),
'from' => ['address' => null, 'name' => null],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('[email protected]***********.mailgun.org'),
'password' => env('sandboxpassword'),
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => env('MAIL_PRETEND', false),
A've mit der env Datei gestoppt, so wird standardmäßig die mail.php, aber wenn die Attribute die gleichen Details sind es das gleiche Ergebnis. Und ja, nur wenn es gefragt wird, ich weiß, dass Sie den Server neu starten müssen, wenn Sie die .env geändert haben und nur auf der sicheren Seite zu sein, habe ich es getan, beim Ändern der mail.php oder services.php
TestController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Mail;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class TestController extends Controller
{
public function index() {
Mail::raw('Text to e-mail', function ($message) {
$message->from('[email protected]', 'Laravel');
$message->to('[email protected]');
});
return view('welcome');
}
}
die genauen Fehler
ClientException in RequestException.php line 107:
Client error: `POST https://api.mailgun.net/v3//messages.mime` resulted in a `404 NOT FOUND` response:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested (truncated...)
in RequestException.php line 107
at RequestException::create(object(Request), object(Response)) in Middleware.php line 65
at Middleware::GuzzleHttp\{closure}(object(Response)) in Promise.php line 199
at Promise::callHandler('1', object(Response), array(object(Promise), object(Closure), null)) in Promise.php line 152
at Promise::GuzzleHttp\Promise\{closure}() in TaskQueue.php line 60
at TaskQueue->run(true) in Promise.php line 240
at Promise->invokeWaitFn() in Promise.php line 217
at Promise->waitIfPending() in Promise.php line 261
at Promise->invokeWaitList() in Promise.php line 219
at Promise->waitIfPending() in Promise.php line 62
at Promise->wait() in Client.php line 129
at Client->request('post', 'https://api.mailgun.net/v3//messages.mime', array('auth' => array('api', null), 'multipart' => array(array('name' => 'to', 'contents' => '[email protected]'), array('name' => 'message', 'contents' => 'Message-ID: <[email protected]> Date: Wed, 09 Dec 2015 03:08:38 +0000 From: Laravel <[email protected]> To: [email protected] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Text to e-mail', 'filename' => 'message.mime')))) in Client.php line 87
at Client->__call('post', array('https://api.mailgun.net/v3//messages.mime', array('auth' => array('api', null), 'multipart' => array(array('name' => 'to', 'contents' => '[email protected]'), array('name' => 'message', 'contents' => 'Message-ID: <[email protected]> Date: Wed, 09 Dec 2015 03:08:38 +0000 From: Laravel <[email protected]> To: [email protected] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Text to e-mail', 'filename' => 'message.mime'))))) in MailgunTransport.php line 79
at Client->post('https://api.mailgun.net/v3//messages.mime', array('auth' => array('api', null), 'multipart' => array(array('name' => 'to', 'contents' => '[email protected]'), array('name' => 'message', 'contents' => 'Message-ID: <[email protected]> Date: Wed, 09 Dec 2015 03:08:38 +0000 From: Laravel <[email protected]> To: [email protected] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Text to e-mail', 'filename' => 'message.mime')))) in MailgunTransport.php line 79
at MailgunTransport->send(object(Swift_Message), array()) in Mailer.php line 85
at Swift_Mailer->send(object(Swift_Message), array()) in Mailer.php line 395
at Mailer->sendSwiftMessage(object(Swift_Message)) in Mailer.php line 181
at Mailer->send(array('raw' => 'Text to e-mail'), array(), object(Closure)) in Mailer.php line 133
at Mailer->raw('Text to e-mail', object(Closure)) in Facade.php line 219
at Facade::__callStatic('raw', array('Text to e-mail', object(Closure))) in TestController.php line 17
at Mail::raw('Text to e-mail', object(Closure)) in TestController.php line 17
at TestController->index()
Können Sie uns den entsprechenden Code zeigen? – James
Ich habe den Code hinzugefügt, der meiner Meinung nach relevant ist, aber dort gibt es keine Fehler. Wenn Sie etwas anderes möchten, sagen Sie einfach. Danke für die Hilfe –
Welchen Code verwenden Sie, um Ihre E-Mail zu senden? – James