I want to send emails using php mail() function using xampp on ubuntu. But its not sent. Please check my code. Do I need to set any email server like gmail for it or I can do it without gmail?
<?php
$address = "kthakkar@argusoft.com";
$subject = 'Test email';
$body = 'If you can read this, your email is working.';
echo "Attempting to email $address...<br />";
if (mail($address, $subject, $body)) {
echo 'SUCCESS! PHP successfully delivered email to your MTA. If you don\'t see the email in your inbox in a few minutes, there is a problem with your MTA.';
} else {
echo 'ERROR! PHP could not deliver email to your MTA. Check that your PHP settings are correct for your MTA and your MTA will deliver email.';
}
?>
If I use smtp gmail account, its sending mails but not using php mail() as I dont want to share my gmail credentials.