I did search for "
sendmail" but found nothing that really helped.
A common experience for people seems to be
Q-How do I set up to send email?
A-Easy! Just change A,B, and C like this, and then do this ...
Q-Thanks; I did all that but it still does not work.
A-There is no A. Just silence.
I altered php.ini like this
- Code: Select all
[mail function]
; For Win32 only.
SMTP = mail.myisp.com.au
smtp_port = 25
; For Win32 only.
sendmail_from = me@myemail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
And I altered
sendmail.ini like this:
- Code: Select all
; if your smtp server requires authentication, modify the following two lines
auth_username=myusername
auth_password=mypassword
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines
pop3_server=mail.myisp.com.au
pop3_username=myusername
pop3_password=mypassword
And I used this script...
- Code: Select all
<?php
$from_name = "Angus";
$from_email = "outgoing@myemail.com";
$headers = "From: $from_name <$from_email>";
$body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
$subject = "Test mail from Justrealized";
$to = "myemail@myisp.com";
if (mail($to, $subject, $body, $headers)) {
echo "success!";
} else {
echo "fail…";
}
?>
Note of course I changed the various email addresses to protect privacy.
The problem I have following any of the tutorials I see is that they refer to .ini or .conf files that either don't exist on my setup, or exist at a different location. It's rare to see any instruction on google less than a year or 2 old, and I suspect that different versions of XAMPP have various files at different locations, or in a different format.
Ideally I don't want to be dependent on my ISP's SMTP server, and after (literally) weeks of reading and searching I have found just as many articles saying XAMPP *CAN* be made to work without an external SMTP as I have found saying it *CANT*. All the articles look very convincing, and they all say something like "This is a commonly asked question and there's lots of confusion so I'm posting this to clear it all up." But they never specify the version of XAMPP they refer to. They then go on to refer to files that aren't there, files that are in a different location, or files with set\up options that are different to mine. Often they say "Here's how to send emails on a WIndows machine" and then go on to tell you to change setup options with the heading "; For Unix only."
Sorry to rant but Sheesh. This really is hard. I would prefer silence to all the misinformation that seems to be out there.