Laravel发送默认电子邮件(不使用SMTP) [英] Laravel send default email ( without SMTP )

查看:142
本文介绍了Laravel发送默认电子邮件(不使用SMTP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能在laravel中发送不带smtp配置的默认php电子邮件吗?像在PHP中使用X-Mailer吗?

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

推荐答案

在几乎不希望指定发件人电子邮件的情况下,我使用标准的PHP mail()函数:

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();

这篇关于Laravel发送默认电子邮件(不使用SMTP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆