Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Email is not sending

Hi

I'm using laravel and is working fine, but the mail component doesn't works. Then I tried with php mail() function like this:

public function mailtest(){

  $from      = 'user@mydomian.com';

    $to      = 'receiveruser@reciverdomain.com';
  $subject = 'the subject';
  $message = 'hello';
  $headers = 'From: ' . $from . "\r\n" .
      'Reply-To: ' . $from . "\r\n" .
      'X-Mailer: PHP/' . phpversion();

  if(mail($to, $subject, $message, $headers)){
    echo "sent";
  }else{
    echo "not sent";
  }

}

it excecutes well (shows 'sent' in the result view), but i never receive the mail.
I checked many discussions about, and tested many combinations, but still not working.
(I used real directions in the real code)

Any idea???

Comments

  • Aclaration: I can send and receive mails using the cpanel webmail, and it delivers well.

  • Tested using plain php without laravel and didn't worked either

  • @pfiore said:
    Hi

    I'm using laravel and is working fine, but the mail component doesn't works. Then I tried with php mail() function like this:

    public function mailtest(){
    
      $from      = 'user@mydomian.com';
    
        $to      = 'receiveruser@reciverdomain.com';
      $subject = 'the subject';
      $message = 'hello';
      $headers = 'From: ' . $from . "\r\n" .
          'Reply-To: ' . $from . "\r\n" .
          'X-Mailer: PHP/' . phpversion();
    
      if(mail($to, $subject, $message, $headers)){
        echo "sent";
      }else{
        echo "not sent";
      }
    
    }
    

    it excecutes well (shows 'sent' in the result view), but i never receive the mail.
    I checked many discussions about, and tested many combinations, but still not working.
    (I used real directions in the real code)

    Any idea???

    https://infinityfree.net/support/php-mail/

Sign In or Register to comment.