我想在laravel(使用hostgator托管)而不是smtp中使用简单的php邮件功能 我应该在mail.php和.env中进行更改以实现它 HostGator的
.env文件
MAIL_DRIVER=mail MAIL_HOST=mail.mydomail.com MAIL_PORT=587 MAIL_USERNAME=my email address MAIL_PASSWORD=email password MAIL_ENCRYPTION=none //as SSL is disabled
我想在laravel中实现php邮件功能,但是由于某种原因它不起作用,虽然当我运行简单的PHP脚本,即 SIMPLE PHP SCRIPT我用hostgator测试它正在发送邮件我只想使用laravel实现相同 以下是我的 index.php
$to = "mailhostingserver@gmail.com";
$subject = "This is subject";
$message = "This is simple text message.";
$header = "From:support@domain.in \r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true )
{
echo "Message sent successfully...";
}
else { echo "Message could not be sent..."; } ?>
我只想在laravel中实现上面的index.php代码