tidak bisa send email ke mailgun ( he parameters passed to the API were invalid )

saya lg coba bikin maillist laravel 5.4 menggunakan mailgun , subs dan unsub sudah berhasil. sekarang tinggal pengetesan kirim email massal .

controller saya package yg saya pakai <a href='https://github.com/Bogardo/Mailgun '>https://github.com/Bogardo/Mailgun </a>


public function sendemail()
    {
    		$data = [
				'customer' => 'John Smith',
				'url' => 'http://laravel.com'
			];


			$data2 = Mailgun::send('emails.welcome', $data, function ($message) {
				$message->to('my_list@sandbox6d7ed41783184eb2bdaa28537da3cd4c.mailgun.org', 'John Smith')->subject('Welcome!');

			});

			dd($data2);
    }

ketika di runnning error nya

  MissingRequiredParameters
The parameters passed to the API were invalid. Check your inputs! Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.

jika di lihat log control panel mailgun nya

{
    "tags": [],
    "timestamp": 1496898562.069961,
    "log-level": "warn",
    "id": "xHDdBeZHRxSFDSxHYXUx6A",
    "campaigns": [],
    "user-variables": {},
    "flags": {
        "is-test-mode": false
    },
    "reject": {
        "reason": "Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.",
        "description": ""
    },
    "message": {
        "headers": {
            "to": "John Smith <my_list@sandbox6d7ed41783184eb2bdaa28537da3cd4c.mailgun.org>",
            "message-id": "20170608050922.84209.F6CF269BE7795EE9@sandbox6d7ed41783184eb2bdaa28537da3cd4c.mailgun.org",
            "from": "ajie hatajie <hatajie@gmail.com>",
            "subject": "Welcome!"
        },
        "attachments": [],
        "size": 512
    },
    "event": "rejected"
}
avatar hatajie
@hatajie

11 Kontribusi 4 Poin

Diperbarui 6 tahun yang lalu

4 Jawaban:

$message->to('my_list@sandbox6d7ed41783184eb2bdaa28537da3cd4c.mailgun.org', 'John Smith')->subject('Welcome!');

sending nya jangan ke sandbox, ke email agan beneran

avatar rachmatsasongko
@rachmatsasongko

410 Kontribusi 426 Poin

Dipost 6 tahun yang lalu

apa karena domain nya itu sanbox ya ( tester ) bukan real domain jd yg receive itu harus verify dlu.

avatar hatajie
@hatajie

11 Kontribusi 4 Poin

Dipost 6 tahun yang lalu

oh iya gan klo ke email pribadi bisa ( email akun mailgun ) paham kyknya saya . ane pas testing pake beberapa email blm di verify . jd pas testing email itu si mailgun hanya mau kirim email yg sudah di verify tujuan nya biar gak kedetek spam.

klo real project harus daftarin domain dlu ya . td saya daftarin domain blog saya dan harus setting beberapa step . barangkali agan disni ada yg udah pake mailgun di real project bisa di share settingan mailgun di cpanel nya

trims

avatar hatajie
@hatajie

11 Kontribusi 4 Poin

Dipost 6 tahun yang lalu

setelah coba daftarin ke real domain saya . dan sudah di verify dengan seting dns dan cname di cpanel.

lalu saya tes kembali dan tetap error

  public function sendemail()
    {
    		$data = [
				'customer' => 'John Smith',
				'url' => 'http://laravel.com'
			];

			$to = config('mailgun.domain');
			$data2 = Mailgun::send('emails.welcome', $data, function ($message) {
				$message->to('news@mg.hatajie.com', 'John Smith')->subject('Welcome!');

			});

			dd($data2);
    }
 ) MissingRequiredParameters
The parameters passed to the API were invalid. Check your inputs! Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.

logs

 {
    "tags": [],
    "timestamp": 1496901875.961396,
    "log-level": "warn",
    "id": "FzbETSiXRZm4Q2pUcfqRVw",
    "campaigns": [],
    "user-variables": {},
    "flags": {
        "is-test-mode": false
    },
    "reject": {
        "reason": "Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.",
        "description": ""
    },
    "message": {
        "headers": {
            "to": "John Smith <news@mg.hatajie.com>",
            "message-id": "20170608060435.94665.8ED6D4F277B6AB45@mg.hatajie.com",
            "from": "ajie hatajie <hatajie@gmail.com>",
            "subject": "Welcome!"
        },
        "attachments": [],
        "size": 435
    },
    "event": "rejected"
avatar hatajie
@hatajie

11 Kontribusi 4 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban