infodigger
asked on
php.ini mail function: Send mail through remote server with authentication
Hi,
I am looking to use a remote smtp server for all emails from our server. On the php.ini file it has the lines:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i ;
How should I change them to use a remote smtp server with remote authenticaiton?
I am looking to use a remote smtp server for all emails from our server. On the php.ini file it has the lines:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i ;
How should I change them to use a remote smtp server with remote authenticaiton?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if the mail function of php is used you are stuck to change that code everywhere to a stub function with an include which then uses the phpmailer class. IT is not possible via php.ini or any other config option.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Perhaps you could write you own mail function that uses phpMailer such as mymail() that takes in essentially the same parameters as the php mail function. Then you could do a find/replace on each of you php files to replace the " mail(" with " mymail("
ASKER
Now I thought of another way. Is it possible to configure the sendmail program on the server to send through authenticated remote smtp?
ASKER
I just found this: http://blog.phpdoc.info/archives/20-mail-replacement-a-better-hack.html
it seems what I am looking for but if you look down at the script it doesn't use authentication. Maybe someone knows what variables I have to add to authenticate with PEARS?
it seems what I am looking for but if you look down at the script it doesn't use authentication. Maybe someone knows what variables I have to add to authenticate with PEARS?
ASKER