在lalavel中使用简单的Php邮件功能而不是Hostgator中的SMTP

时间:2016-05-04 15:41:27

标签: laravel

  

我想在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代码

0 个答案:

没有答案