0

I am new laravel and i just made a small project of article posting and on user registration i just want to send successfully register email to user email. I searched every where in all tutorials they are giving demo for send mail from gmail and some another email providers. I just want to know is it possible to send the mail simply from server email id ? like cordignator framework:

$this->email->to('[email protected]') $this->email->subject('Testing Email') $this->email->message('hello') $this->email->send() 

1 Answer 1

2

set your server mail details in .env file then run a command php artisan publish

send mail like Mail::to($user)->send(new UserRegister());

and your UserRegister class in app/Mail have one method

public function build() { return $this->subject("Welcome to My site") ->view('`vendor.notifications.register`',compact('')); } 

And You can set all message body in resourse/view/vendor/notifications/register

see more on laravel mail

Sign up to request clarification or add additional context in comments.

7 Comments

ok..means i do not need to add any smtp details in .env file?
oh sorry you have to add your mail detail in .env file also
which email details in need to put there ?? in simple php we just use mail function to,subject,message
MAIL_DRIVER=smtp MAIL_HOST=<your mail host> MAIL_PORT=25 MAIL_USERNAME=<your mail address> MAIL_PASSWORD=<your password>
you means server email id: [email protected] ?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.