Hi,
it is possible that you don't need to do anything if sendmail is installed and set up correctly. If you have problems you might need to set the path to sendmail in php.ini and/or install sendmail:
Example taken from php.ini:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =
Uncomment that sendmail_path line and set the path to sendmail, e.g.
sendmail_path = /usr/sbin/sendmail -t -i
Additionally, you might need to modify the sendmail configuration a little bit.
If sendmail isn't set up to use a smtp host for delivery but to send mails directly the problem might occur that sendmail uses the hostname for sending the mails (however, that could even happen if sendmail is configured to use a mail host for mail delivery).
Example (sendmail):
Your server host name is myhost.mydomain.com
Sendmail might per default send mails of the apache user as e.g.
wwwrun@myhost.mydomain.com
If myhost.mydomain.com isn't resolvable externally many mail servers would reject to accept the mail for delivery.
You can do the following to solve that problem:
edit /etc/mail/genericstable and add a line like (modify wwwrun to match the user the web server is running as):
wwwrun info@mydomain.com
or
wwwrun wwwrun@mydomain.com
Put tabs between wwwrun and wwwrun@mydomain.com, do not use spaces.
then run
makemap hash /etc/mail/genericstable.db < /etc/mail/genericstable
(make a backup of genericstable.db before that)
==> Additionally, you might want to edit /etc/sendmail.cf:
If you have access to a mail server you could set the following configuration variables:
who I send unqualified names to (null means deliver locally)
DRmailhost.mydomain.com.
who gets all local email traffic ($R has precedence for unqualified names)
DHmailhost.mydomain.com.
who I masquerade as (null for no masquerading) (see also $=M)
Dmydomain.com
==> and you might need to set some domains if you want to use domains that are not mydomain.com:
class E: names that should be exposed as from this host, even if we masquerade
class L: names that should be delivered locally, even if we have a relay
class M: domains that should be converted to $M
class N: domains that should not be converted to $M
#CL root
C{G}mydomain2.com mydomain.com myhost.mydomain.com
You could then use e.g.
wwwrun info@mydomain2.com
in genericstable. That doesn't work if you don't add mydomain2.com to C{G} as mentioned above.
Then restart sendmail and try to send a mail with the php mail function.
If you don't want to mess around with sendmail you could also use one of the SMTP classes available at nearly any php library like the one on phpbuilder.com
Hope that doesn't confuse you too much (at least that worked for me, but I'm not that deep sendmail expert)
Thomas