Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Mailtodisk Error Message
I am on the Absolute Paths section of the Enhancing A Simple PHP App course. I am having problems trying to find my document root folder. I have entered this code at the top of my index.php file inside the Receipt directory.
I am entering information into the contact form and submitting it. Then, I receive an error message that says "mailtodisk.exe" and that basically it's trying to write to my disk drive. I'm sure it's something related to phpmailer, but I haven't figured it out yet.
Thanks as always!
PS I should have mentioned that I am using a XAMPP server on Windows 8.
Sean T. Unwin28,672 Points
I assume you're running Mercury Mail with your xampp installation. Either turn it off if you don't use it or attempt the following.
You may have to edit a line or two in your
php.ini file. This file is probably located in
C:\xampp\php\php.ini - or where your xampp install directory then the php directory.
php.ini is open in an editor search for the following line (mine was near line #1140):
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder) ;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t" ; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
; from start of
;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
; to the start of
sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
Then save the file (you may need administrator rights for this) and restart Apache.
Let's hope for the best and see if that works. :)
Thanks for all of your help. I think I'm going to call it quits on using Mercury, and try using SMTP with phpmailer. Thanks again for taking the time. Appreciate it.