Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel send default email ( without SMTP )

Tags:

php

email

laravel

it's possible in laravel to send a default php email without the smtp config ? Like in php with X-Mailer ?

like image 249
Sebastian Manuelli Avatar asked Feb 08 '16 13:02

Sebastian Manuelli


People also ask

Can I send email without SMTP server?

Without an SMTP server, you cannot send your email to its destination. When you click the “send” button from your email client, your email messages get automatically converted into a string of codes and are transferred to your SMTP server.

Can we send mail from localhost in Laravel?

In the same way, you can also set up other Mail providers like Mailgun, Sendgrid, Mandrill, Mailchimp, etc. to send the mail from Localhost in Laravel.

How do I send an email in Laravel?

Laravel provides a clean, simple email API powered by the popular Symfony Mailer component. Laravel and Symfony Mailer provide drivers for sending email via SMTP, Mailgun, Postmark, Amazon SES, and sendmail , allowing you to quickly get started sending mail through a local or cloud based service of your choice.


1 Answers

I use the standard PHP mail() function for situations when I want to specify the sender email hardly:

$to = env('MAIL_USERNAME'); 
$subject = $request->title; 
$message = $request->message; 
$headers = 'From: ' . $request->email . "\r\n" . 
'Reply-To: ' . $request->email . "\r\n" . 
'X-Mailer: PHP/' . phpversion();
like image 122
Paul Basenko Avatar answered Oct 13 '22 01:10

Paul Basenko