I cannot get XAMPP to send a dummy email from PHP using mailtodisk.exe (in other words, to save the output to the disk instead of really sending the mail). Instead, no matter what I do, the mails keep being sent normally. I am trying to set it to not really send the mails but to generate their output, using the mailtodisk.exe utility that comes with XAMPP.
My php.ini settings seem correct to me (although I do not know whether the sendmail_path needs to be in escaped quotes as the commented sendmail.exe's path is - in any case, I tried both and neither worked):
; sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
phpinfo() also shows that the settings are correct:
I tried setting the "sendmail_path" variable directly from the source code using ini_set(), I tried altering the "php.ini-production" and "php.ini-development" files as well (although pointlessly if you ask me), I even deleted the whole sendmail.exe containing folder completely, I did restart Apache every time I changed a setting, and it's still sending normal mails. My system is running Windows 10, XAMPP version is 3.2.2 and php version is 5.6.14.
What am I missing here?
EDIT: I neglected to mention that it used to work properly in the beginning, when I first installed XAMPP. Then at some point I needed to send an actual mail, so I changed the php.ini to use sendmail.exe, and I never managed to restore it ever since.
If you use PHPMailer to send your messages you need to ensure that it isn't using SMTP (if it opens a network connection to a remote server it won't use your local mailer). To do so you need to not call isSMTP()
because the default method is to use built-in mail()
function:
/**
* Which method to use to send mail.
* Options: "mail", "sendmail", or "smtp".
* @type string
*/
public $Mailer = 'mail';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With