Re: PHP mail() function and TMDA
Stephen Warren <[email protected]>
| Newsgroups | gmane.mail.spam.tmda.user |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Keith Roberts wrote:
> Are there any particular things to do to set up PHP5 under
> FC6 Linux, to send mail with the built-in PHP mail()
> function, while using TMDA? I have an outgoing TMDA log, but
> nothing appears in the log when I load a page with the
> following code. I do not receive the email either.
> ...
> if ( mail($to, $subject, $message, $headers) ) {
> echo "mail sent OK!";
> }
> else {
> echo "Problem sending mail - :(";
> }
There's nothing in the code to say which server to connect to for
outbound mail. I guess the internals of the mail() function does one of:
* Connect to local SMTP server
* Invoke local /usr/bin/sendmail
* Perform an MX lookup and send the mail directly to the target server
(incidentally, web scripts etc. should *never* do this[1])
You'll need to find out how mail() operates, in order to determine how
to solve the problem.
[1] What happens if the destination server isn't there; the mail just
gets lost - always send to a local server so it can perform retries if
required.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGqNhLhk3bo0lNTrURAl/XAJ4wtpDUXP4wRYhdmKp5pfI55q/WowCgwJGf
rkiy15Jdtr2U8B+lhF54JhY=
=t8Tt
-----END PGP SIGNATURE-----