You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Now you can use $config to interact with Mailtrap Sending API
$sendingClient = (new MailtrapSendingClient($config))->emails();
try {
$email = (new MailtrapEmail())
->from(new Address('example@YOUR-DOMAIN-HERE.com', 'Mailtrap Test')) // <--- you should use your domain here that you installed in the mailtrap.io admin area (otherwise you will get 401)
->to(new Address('email@example.com', 'Jon'))
->subject('Hello from Mailtrap!')
->text('Welcome to Mailtrap Sending!')
;
$response = $sendingClient->send($email);
var_dump(ResponseHelper::toArray($response)); // body (array)