Email is not sending


#1

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\

" .
'Reply-To: ’ . $from . "\r
" .
‘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???


#2

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


#3

Tested using plain php without laravel and didn’t worked either


#4

@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\

" .

      'Reply-To: ' . $from . "\\r\

" .

      '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/


closed #5