Test PHP's mail function from localhost

前端 未结 7 1772

I need to test a function that uses PHP\'s mail()
How can I do this without uploading the script to a server and test it online?
What\'s even more I am developin

7条回答
  •  借酒劲吻你
    2020-12-04 17:27

    To test sending email from apache do the following

    create a folder to store the email.

    /home/username/Documents/TestEmails
    

    Give permission to apache. From the Documents folder, run

    sudo chgrp -R www-data TestEmails
    

    Modify the php.ini file, mine is located at

    /etc/php5/apache2/php.ini
    

    set sendmail_path

    sendmail_path ='cat > /home/username/Documents/TestEmails/mail.txt'
    

    Restart apace2

    sudo service apache2 restart
    

提交回复
热议问题