When trying on Windows, it is pretty simple. I have this code in the body of a PHP file:
$to = "synewaveltd@gmail.com";
$headers = 'From: synewavecomplaints@gmail.com' . "\r\n" .
'Reply-To: ' . $_POST['email'] . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$fullText = "Complaint from : " . $_POST['email'] . "\r\n" . "Name : " .
$_POST['fullName'] . "\r\n" . $_POST['mainText'] . "\r\n";
mail($to, $_POST['subject'], $fullText, $headers);
And I have this sendmail.ini
file:
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=synewavecomplaints@gmail.com
auth_password=XXXXXXXXXX
force_sender=synewavecomplaints@gmail.com
And basically, what I want to do is send an email from an account called synewavecomplaints@gmail.com
to a different account called synewaveltd@gmail.com
, where the first email has a password. On Windows, this works.
Now on Linux, there is no sendmail.ini
file that comes with LAMPP. I have been browsing all over everywhere for ways I can go around this, like this, but whatever I try, does not work. I even tried to use Postfix using steps from here, but it didn't work either.
I realise that these guides may just be wrong because of how old they are, but I cannot find any recent guides to how to do this. Can anyone tell me how this can be made possible on linux?