Page 1 of 1

Mail Function Setup

PostPosted: 07. May 2019 05:01
by trymeout
How will one on Linux get the mail function to work to be able to create email files (EML) on their computer by using the PHP mail() function? When I was on Windows I used XAMPP and the Test Mail Server Tool.

Re: Mail Function Setup

PostPosted: 07. May 2019 14:21
by Nobbie

Re: Mail Function Setup

PostPosted: 28. June 2019 19:21
by trymeout
I finally figured it out after a month! This is how it is done

1. Create a folder in your Documents named XAMPP Emails
2. Open the terminal and enter the following command

Code: Select all
sudo chmod 777 "/home/USERNAME/Documents/XAMPP Emails/"


3. Open the php.ini file that is located in your /opt/lampp/etc directory
4. Press CTRL+F and then type "mail function"
5. Under the [mail function] remove comment from sendmail_path
6. Set sendmail_path to
Code: Select all
sendmail_path = "cat > /home/USERNAME/Documents/XAMPP\ Emails/`date '+%Y-%m-%d - %H-%M-%S'`.eml"
BUT MAKE SURE TO REPLACE USERNAME with your own username
7. If Apache is running, restart it