Link to home
Start Free TrialLog in
Avatar of sevenpeaks
sevenpeaks

asked on

How to configure email from a php server using exim4?

I currently have a web server running apache/php.  We want to be able to send e-mail through the php command mail().  I was told that you need to install either exim4 or a program similar to that.  I am running Ubuntu so I want to the Synaptic packet manager and I downloaded and installed exim4.  What I have found out so far is that you need to update the php.ini file in order to be able to do this.  I have edited two parts of the php.ini file.
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = me@myserver.com
I am not sure if that is right, if anyone knows please tell me?
Next I need to be able to configure Exim4 since I have not done that yet.  Can anyone tell me how to configure exim4 so that it will work?
I think once I get the php.ini file configured properly and then I get the exim4 stuff set up right it should work.  If that is not the case please let me know.  
Thanks
Avatar of Novitsh
Novitsh
Flag of Belgium image

ASKER CERTIFIED SOLUTION
Avatar of nplib
nplib
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sevenpeaks
sevenpeaks

ASKER

Ok, I  am trying to use the phpmailer program.  I have downloaded it and have placed the class.phpmailer.php into the web directory.  I have edited the php.ini file so that the only line that i have changed is sendmail_path = class.phpmailer.php.  So when I do a test I am getting errors, so I guess that I have not configured it correctly.  Any ideas of what  I am doing wrong?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah once I added the class.phpmailer.php file and the smtp.phpmailer.php file to the web directory then it worked great.  You don't even have to edit the php.ini file at all.   Thanks for your help. This was a lot easier then exim.
Thats why I recommend phpmailer all the way.
I like simple.
Why did I become a programmer?
Why "B"?

did it not solve the problem?
I guess I gave you a B becuase you didn't say anything about the class.smtp.php file that needed to be included.
Also, I didn't have an installer when I downloaded it.  I had to figure out that it didn't need to be installed, that it was just two files that need to be added to the web directory.  
the class.smtp.php file is not to be touched.

just by using $mail->IsSMTP();
it uses that file. Go through line by line of the class.phpmailer.php if you don't believe me.
I know it doesn't have to be touched, but I didn't even know that I had to move it to the directory.