Recently I installed sendmail in Ubuntu
sudo apt install sendmail
sudo sendmailconfig
When I try to send mail using php
email();
function to send email
$to = "myemail@gmail.com";
$subject = "Mail Test at ".strftime("%T", time());
$message = "This is a test.";
$message = wordwrap($message, 70);
$from = "anotheremail@gmail.com";
$headers = "From: {$from}";
$result = mail($to, $subject, $message, $headers);
echo $result ? "sent" : "error";
Now when I browse the php site I get sent message but I don't get email (in my official email).
Can anybody help?
Asked by maverick
(101 rep)
Jan 24, 2018, 08:22 AM
Last activity: Jul 28, 2025, 01:01 AM
Last activity: Jul 28, 2025, 01:01 AM