Thursday, February 28, 2013

Using php to send mail on apache (ubuntu)

I have an Ubuntu in Oracle VM VirtualBox, however i did not set it as a server, I just want to implement  sending  email on ubuntu.
Make it short:using sendmail.
installing sendmail on ubuntu


in the file:  /etc/php5/apache2/php.ini
make it like this:  sendmail_path = /usr/sbin/sendmail -t -i
sudo apt-get install sendmail
sudo apt-get install sendmail-cf

then we can use the following code to send mail:






this is only a test, you can change the code according to your demand.
done!

No comments:

Post a Comment