469,913 Members | 1,954 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

mail function and sendmail

Hi all,

The PHP manual states that: "The Windows implementation of mail()
differs in many ways from the Unix implementation. First, it doesn't
use a local binary for composing messages but only operates on direct
sockets which means a MTA is needed listening on a network socket
(which can either on the localhost or a remote machine). "

Does this mean that the sendmail binary is NOT needed on windows?

Also, the manual used to state that:

"For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. If you use another
mail program, such as qmail or postfix, be sure to use the appropriate
sendmail wrappers that come with them. PHP will first look for
sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/
usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have
sendmail available from your PATH. Also, the user that compiled PHP
must have permission to access the sendmail binary."

I couldn't find this in the manual anymore, is it still applicable?
What if you are downloading the PHP binaries, do you need to worry
about this?

Thanks

Taras
Jul 9 '08 #1
11 1755
Taras_96 wrote:
Hi all,

The PHP manual states that: "The Windows implementation of mail()
differs in many ways from the Unix implementation. First, it doesn't
use a local binary for composing messages but only operates on direct
sockets which means a MTA is needed listening on a network socket
(which can either on the localhost or a remote machine). "

Does this mean that the sendmail binary is NOT needed on windows?

Also, the manual used to state that:

"For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. If you use another
mail program, such as qmail or postfix, be sure to use the appropriate
sendmail wrappers that come with them. PHP will first look for
sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/
usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have
sendmail available from your PATH. Also, the user that compiled PHP
must have permission to access the sendmail binary."

I couldn't find this in the manual anymore, is it still applicable?
What if you are downloading the PHP binaries, do you need to worry
about this?

Thanks

Taras
No, you don't need a sendmail binary on Windows - and never have, AFAIK.
You do need access to an MTA, which can be running on your system or
another (such as your ISP). You set the host in your php.ini file.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 9 '08 #2
Greetings, Taras_96.
In reply to message from Jerry Stuckle dated Wednesday, July 9, 2008, 16:25:01,
>The PHP manual states that: "The Windows implementation of mail()
differs in many ways from the Unix implementation. First, it doesn't
use a local binary for composing messages but only operates on direct
sockets which means a MTA is needed listening on a network socket
(which can either on the localhost or a remote machine). "

Does this mean that the sendmail binary is NOT needed on windows?

Also, the manual used to state that:

"For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. If you use another
mail program, such as qmail or postfix, be sure to use the appropriate
sendmail wrappers that come with them. PHP will first look for
sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/
usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have
sendmail available from your PATH. Also, the user that compiled PHP
must have permission to access the sendmail binary."

I couldn't find this in the manual anymore, is it still applicable?
What if you are downloading the PHP binaries, do you need to worry
about this?
No, you don't need a sendmail binary on Windows - and never have, AFAIK.
You do need access to an MTA, which can be running on your system or
another (such as your ISP). You set the host in your php.ini file.
Strictly speaking, it is possible to have sendmail (or at least ssmtp) on
windows system... but that's a waste of mind. PHP can interact directly with
SMTP server and it is adwised to do it that way in php.ini.
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jul 10 '08 #3
AnrDaemon wrote:
Greetings, Taras_96.
In reply to message from Jerry Stuckle dated Wednesday, July 9, 2008, 16:25:01,
>>The PHP manual states that: "The Windows implementation of mail()
differs in many ways from the Unix implementation. First, it doesn't
use a local binary for composing messages but only operates on direct
sockets which means a MTA is needed listening on a network socket
(which can either on the localhost or a remote machine). "

Does this mean that the sendmail binary is NOT needed on windows?

Also, the manual used to state that:

"For the Mail functions to be available, PHP must have access to the
sendmail binary on your system during compile time. If you use another
mail program, such as qmail or postfix, be sure to use the appropriate
sendmail wrappers that come with them. PHP will first look for
sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/
usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have
sendmail available from your PATH. Also, the user that compiled PHP
must have permission to access the sendmail binary."

I couldn't find this in the manual anymore, is it still applicable?
What if you are downloading the PHP binaries, do you need to worry
about this?
>No, you don't need a sendmail binary on Windows - and never have, AFAIK.
You do need access to an MTA, which can be running on your system or
another (such as your ISP). You set the host in your php.ini file.

Strictly speaking, it is possible to have sendmail (or at least ssmtp) on
windows system... but that's a waste of mind. PHP can interact directly with
SMTP server and it is adwised to do it that way in php.ini.
Gotta stick your nose in again with another worthless comment, huh?
>[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 10 '08 #4
Greetings, Jerry Stuckle.
In reply to Your message dated Friday, July 11, 2008, 1:17:35,
Gotta stick your nose in again with another worthless comment, huh?
Not as worthless as your answer to my post.
(TBH, I've found ssmtp/W32 very useful, but that's not PHP related issue)
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jul 11 '08 #5
On Fri, 11 Jul 2008 00:13:03 +0400, AnrDaemon wrote:
Greetings, Taras_96. In reply to message from Jerry Stuckle dated
Wednesday, July 9, 2008, 16:25:01,
>No, you don't need a sendmail binary on Windows - and never have,
AFAIK. You do need access to an MTA, which can be running on your
system or another (such as your ISP). You set the host in your
php.ini file.

Strictly speaking, it is possible to have sendmail (or at least ssmtp)
on windows system... but that's a waste of mind. PHP can interact
directly with SMTP server and it is adwised to do it that way in
php.ini.
What happens to the script it the remote SMTP server is temporarily
unavailable? You needn't actually answer, but it's something that *does*
need to be accounted for without a local MTA daemon. sendmail and it's
work-alike wrapped replacements are at least guaranteed to accept and
hold mails for the SMTP service to come back, but sSTMP and the build-in
Windows PHP mailer are not.

--
11. I will be secure in my superiority. Therefore, I will feel no need to prove
it by leaving clues in the form of riddles or leaving my weaker enemies
alive to show they pose no threat.
--Peter Anspach's list of things to do as an Evil Overlord
Jul 11 '08 #6
Peter H. Coffin wrote:
On Fri, 11 Jul 2008 00:13:03 +0400, AnrDaemon wrote:
>Greetings, Taras_96. In reply to message from Jerry Stuckle dated
Wednesday, July 9, 2008, 16:25:01,
>>No, you don't need a sendmail binary on Windows - and never have,
AFAIK. You do need access to an MTA, which can be running on your
system or another (such as your ISP). You set the host in your
php.ini file.
Strictly speaking, it is possible to have sendmail (or at least ssmtp)
on windows system... but that's a waste of mind. PHP can interact
directly with SMTP server and it is adwised to do it that way in
php.ini.

What happens to the script it the remote SMTP server is temporarily
unavailable? You needn't actually answer, but it's something that *does*
need to be accounted for without a local MTA daemon. sendmail and it's
work-alike wrapped replacements are at least guaranteed to accept and
hold mails for the SMTP service to come back, but sSTMP and the build-in
Windows PHP mailer are not.
The same thing that happens when the local MTA isn't available. The
function call fails.

But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 11 '08 #7
Peter H. Coffin wrote:
On Thu, 10 Jul 2008 21:02:52 -0400, Jerry Stuckle wrote:
>Peter H. Coffin wrote:
>>On Fri, 11 Jul 2008 00:13:03 +0400, AnrDaemon wrote:

Greetings, Taras_96. In reply to message from Jerry Stuckle dated
Wednesday, July 9, 2008, 16:25:01,

No, you don't need a sendmail binary on Windows - and never have,
AFAIK. You do need access to an MTA, which can be running on your
system or another (such as your ISP). You set the host in your
php.ini file.
Strictly speaking, it is possible to have sendmail (or at least ssmtp)
on windows system... but that's a waste of mind. PHP can interact
directly with SMTP server and it is adwised to do it that way in
php.ini.
What happens to the script it the remote SMTP server is temporarily
unavailable? You needn't actually answer, but it's something that *does*
need to be accounted for without a local MTA daemon. sendmail and it's
work-alike wrapped replacements are at least guaranteed to accept and
hold mails for the SMTP service to come back, but sSTMP and the build-in
Windows PHP mailer are not.
The same thing that happens when the local MTA isn't available. The
function call fails.

Ah, but if a local MTA isn't available, that's *your* fault, not someone
else's.
>But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.

Ain't that big a deal. Have the local MTA rigged to deliver to the
remote MTA the same way as whatever the sSMTP or built-in mailer would
do. All the good MTAs can play nicely with smarthosts at least as well
as all good mail clients.
If you have a smarthost on the other end which accepts relays for other
domains. There aren't many of those out there unless you have a VPS or
dedicated server.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 18 '08 #8
On Fri, 18 Jul 2008 16:29:09 -0400, Jerry Stuckle wrote:
Peter H. Coffin wrote:
>On Thu, 10 Jul 2008 21:02:52 -0400, Jerry Stuckle wrote:
>>The same thing that happens when the local MTA isn't available. The
function call fails.

Ah, but if a local MTA isn't available, that's *your* fault, not
someone else's.
>>But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.

Ain't that big a deal. Have the local MTA rigged to deliver to the
remote MTA the same way as whatever the sSMTP or built-in mailer
would do. All the good MTAs can play nicely with smarthosts at least
as well as all good mail clients.


If you have a smarthost on the other end which accepts relays for
other domains. There aren't many of those out there unless you have a
VPS or dedicated server.
If you can't get mail out with an MTA, you can't get mail out with
sSMTP. And there are transitory circumstances under which you CAN get
mail out with a real MTA that would fail with sSMTP. That's the whole
of my point.

--
65. If I must have computer systems with publically available terminals, the
maps they display of my complex will have a room clearly marked as the Main
Control Room. That room will be the Execution Chamber. The actual main
control room will be marked as Sewage Overflow Containment. --Overlord
Jul 21 '08 #9
Peter H. Coffin wrote:
On Fri, 18 Jul 2008 16:29:09 -0400, Jerry Stuckle wrote:
>Peter H. Coffin wrote:
>>On Thu, 10 Jul 2008 21:02:52 -0400, Jerry Stuckle wrote:

The same thing that happens when the local MTA isn't available. The
function call fails.
Ah, but if a local MTA isn't available, that's *your* fault, not
someone else's.

But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.
Ain't that big a deal. Have the local MTA rigged to deliver to the
remote MTA the same way as whatever the sSMTP or built-in mailer
would do. All the good MTAs can play nicely with smarthosts at least
as well as all good mail clients.

If you have a smarthost on the other end which accepts relays for
other domains. There aren't many of those out there unless you have a
VPS or dedicated server.

If you can't get mail out with an MTA, you can't get mail out with
sSMTP. And there are transitory circumstances under which you CAN get
mail out with a real MTA that would fail with sSMTP. That's the whole
of my point.
Not really true. As I indciated, MTA's use port 25 for communications
between systems. Those are now being blocked by more and more ISPs.
However, port 587 is supposed to be used for users to connect to their
MTA and still open. However, if set up properly, port 587 requires
authorization - something a spammer wouldn't have.

So running an MTA on your machine won't help if port 25 outgoing is
blocked. And very few people have access to smarthosts. Those who do
are mainly employees of large companies.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 21 '08 #10

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g6**********@registered.motzarella.org...
Peter H. Coffin wrote:
>On Fri, 18 Jul 2008 16:29:09 -0400, Jerry Stuckle wrote:
>>Peter H. Coffin wrote:

On Thu, 10 Jul 2008 21:02:52 -0400, Jerry Stuckle wrote:

The same thing that happens when the local MTA isn't available. The
function call fails.
Ah, but if a local MTA isn't available, that's *your* fault, not
someone else's.

But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.
Ain't that big a deal. Have the local MTA rigged to deliver to the
remote MTA the same way as whatever the sSMTP or built-in mailer
would do. All the good MTAs can play nicely with smarthosts at least
as well as all good mail clients.

If you have a smarthost on the other end which accepts relays for
other domains. There aren't many of those out there unless you have a
VPS or dedicated server.

If you can't get mail out with an MTA, you can't get mail out with
sSMTP. And there are transitory circumstances under which you CAN get
mail out with a real MTA that would fail with sSMTP. That's the whole
of my point.

Not really true. As I indciated, MTA's use port 25 for communications
between systems. Those are now being blocked by more and more ISPs.
However, port 587 is supposed to be used for users to connect to their MTA
and still open. However, if set up properly, port 587 requires
authorization - something a spammer wouldn't have.
wow, jerry! kinda, but not really? an explanation would really be amusing
here!

if set up properly, any port (25 inclusive) can be made to require
authorization...but that's not even a direct counter to 'all the good mtas
can play nicely with smarthosts...'. it's not even a side-ways counter. it's
nothing to do with the point.
So running an MTA on your machine won't help if port 25 outgoing is
blocked. And very few people have access to smarthosts. Those who do are
mainly employees of large companies.
you keep using terms like 'very few people' and 'those are now being blocked
by more and more isps'. it begs the question jerry. care to quantify that
with cited materials? that would certainly help you make a case that
'playing nicely' is play that is hard to come by these days.

why do you go soooo far off tangent from what the OP actually asks? usually
it shows you making unsubstantiated claims...and shows your lack of
knowledge in anything not directly php code language specific, i.e. how
email works.

hmmmm...here's a test. tell us, oh knowledgable one, what 'transitory
circumstances' would they be that would allow mail out with a real MTA but
where a binary such as sstmp would fail? i can think of a couple off the top
of my head. if any had come to your mind, i'm sure you wouldn't have strayed
so far from the point, and as readily!

and btw, nice display of christianly love with the response to arn! at least
my 'lying' involves keeping my mouth shut...yours careens out of your pie
hole with the unrelently onslaught of your typing fingers! we'd all much
appreciate you lying in the manner i espouse. :)

keep your yap shut, jer.
Jul 21 '08 #11

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g6**********@registered.motzarella.org...
Peter H. Coffin wrote:
>On Fri, 18 Jul 2008 16:29:09 -0400, Jerry Stuckle wrote:
>>Peter H. Coffin wrote:

On Thu, 10 Jul 2008 21:02:52 -0400, Jerry Stuckle wrote:

The same thing that happens when the local MTA isn't available. The
function call fails.
Ah, but if a local MTA isn't available, that's *your* fault, not
someone else's.

But considering how many ISP's are now blocking port 25 for outgoing
email, it doesn't make much sense to run your own email server.
Ain't that big a deal. Have the local MTA rigged to deliver to the
remote MTA the same way as whatever the sSMTP or built-in mailer
would do. All the good MTAs can play nicely with smarthosts at least
as well as all good mail clients.

If you have a smarthost on the other end which accepts relays for
other domains. There aren't many of those out there unless you have a
VPS or dedicated server.

If you can't get mail out with an MTA, you can't get mail out with
sSMTP. And there are transitory circumstances under which you CAN get
mail out with a real MTA that would fail with sSMTP. That's the whole
of my point.

Not really true. As I indciated, MTA's use port 25 for communications
between systems. Those are now being blocked by more and more ISPs.
However, port 587 is supposed to be used for users to connect to their MTA
and still open. However, if set up properly, port 587 requires
authorization - something a spammer wouldn't have.
wow, jerry! kinda, but not really? an explanation would really be amusing
here!

if set up properly, any port (25 inclusive) can be made to require
authorization...but that's not even a direct counter to 'all the good mtas
can play nicely with smarthosts...'. it's not even a side-ways counter. it's
nothing to do with the point.
So running an MTA on your machine won't help if port 25 outgoing is
blocked. And very few people have access to smarthosts. Those who do are
mainly employees of large companies.
you keep using terms like 'very few people' and 'those are now being blocked
by more and more isps'. it begs the question jerry. care to quantify that
with cited materials? that would certainly help you make a case that
'playing nicely' is play that is hard to come by these days.

why do you go soooo far off tangent from what the OP actually asks? usually
it shows you making unsubstantiated claims...and shows your lack of
knowledge in anything not directly php code language specific, i.e. how
email works.

hmmmm...here's a test. tell us, oh knowledgable one, what 'transitory
circumstances' would they be that would allow mail out with a real MTA but
where a binary such as sstmp would fail? i can think of a couple off the top
of my head. if any had come to your mind, i'm sure you wouldn't have strayed
so far from the point, and as readily!

and btw, nice display of christianly love with the response to arn! at least
my 'lying' involves keeping my mouth shut...yours careens out of your pie
hole with the unrelently onslaught of your typing fingers! we'd all much
appreciate you lying in the manner i espouse. :)

keep your yap shut, jer.
Jul 21 '08 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by bonfils | last post: by
4 posts views Thread by CoralineSage | last post: by
4 posts views Thread by Data Goob | last post: by
1 post views Thread by tencip | last post: by
34 posts views Thread by antonyliu2002 | last post: by
6 posts views Thread by cover | last post: by
7 posts views Thread by r0g | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.