jonjie
134
10
Laravel

Modify Email "from" in laravel 5.1

Posted 1 week ago by jonjie

What if I want to use different email addresses depending on the relatedness of the form.

For example, I want to use [email protected] for my contact form. Then I want to use [email protected] for my registration form. How can I implement this?

I've already tried to use the from method but didn't work. Please see my code below.

Mail::later(10,
    [],
    compact('inputs'),
    function($m) use ($email, $inputs){
        $m->from('[email protected]', 'Name');
        $m->to($email)->subject($inputs['subject']);
    }
);

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.