Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying php.ini to enable mail

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Have built a LAMP server, Ubuntu 9.04, and wish to enable the use of a third party SMTP server, such as mail.myserver.com.

There is no mail server installed on the Linux box.

Under WAMP, if I remember correctly, the section required modification in php.ini is
Code:
[mail function]
; ForWin32 only
SMTP = localhost
smtp_port = 25

; ForWin32 only
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as (default: "sendmail -t -i").
;sendmail_path =
The code
Code:
sendmail_path =
would indicate the use of a linux mail server, and if so, which?

If not, is it possible to utilise a third party mail server directly and how?

TIA


FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
if you don't have sendmail installed on your linux box (very odd) then you can use phpMailer (it comes with a pre-coded SMTP class). this would seem the easiest solution if you are not otherwise experienced in *nix

if you want to use the basic mail() functions within php then, for linux installs, you will need sendmail (or some other MTA with sendmail hooks) installed. it's odds on that sendmail is already installed as part of the default distro though, so you might try setting the sendmail path as follows

Code:
sendmail_path = /usr/sbin/sendmail -i -t
and remember to reboot your webserver after making this change.
also remember to set the FROM header in your mail() command (and terminate with \r\n).
 
jpadie

Thanks for your reply.

During the Ubuntu installation process, the mail server option was not checked, in the expectation that a mail server would not be required to access a third party SMTP server.

Will install phpMailer and take it from there.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top