Support the ongoing development of Laravel.io →
Laravel Mail

I have Mailer functionality built into my business app. I'm using smtp to send out client emails. The emails should be send from the client email address but instead are sent from the system. I do not have a default from address in my mail config file

Mail class:

public function build() {
$e_name=$this->name; $e_email=$this->email; $e_number=$this->number; $e_subject=$this->subject; $e_massage=$this->massage;

    return $this->view('layout.sendmail')
            ->from($e_email)
            ->replyTo($e_email)
            ->subject($e_subject)
            ->with(compact('e_name','e_email','e_number','e_massage'));
}

Controller: Mail::to('example@gmail.com')->send(new SendMail($name,$email,$number,$subject,$massage));

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.