By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,190 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,190 IT Pros & Developers. It's quick & easy.

Help with mail using php and apache on windows XP

P: n/a
Hi everybody,
I have been trying to write a simple mail script using PHP and apache
on Windows XP. Eventhough the script is saying that the mail is
successfully sent, I am unable get it in my mailbox(I have given my
mail address in $to). I am using the mail() function and I have made
the following changes in php.ini

[mail function]
; For Win32 only.
SMTP = localhost

smtp_port = 25

; For Win32 only.
sendmail_from = aa*@Comcast.net

CAn anybody help me with this?

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Karuna wrote:
Hi everybody,
I have been trying to write a simple mail script using PHP and apache
on Windows XP. Eventhough the script is saying that the mail is
successfully sent, I am unable get it in my mailbox(I have given my
mail address in $to). I am using the mail() function and I have made
the following changes in php.ini

[mail function]
; For Win32 only.
SMTP = localhost

smtp_port = 25


Do you have a mail server running on your local machine that is
listening on port 25? If you don't this isn't going to work. You
probably want to put the address of your ISP's mail server there, not
localhost.

Ken

Jul 17 '05 #2

P: n/a
Karuna wrote:
I have been trying to write a simple mail script using PHP and apache
on Windows XP. Eventhough the script is saying that the mail is
successfully sent, I am unable get it in my mailbox(I have given my
mail address in $to). I am using the mail() function and I have made
the following changes in php.ini

[mail function]
; For Win32 only.
SMTP = localhost

smtp_port = 25

; For Win32 only.
sendmail_from = aa*@Comcast.net

CAn anybody help me with this?


If you have a SMTP server installed (and correctly configured) on your
machine, you should have no problem with that php.ini.

But ...

I doubt you have a mail server installed on your machine.
You have to specify an /existing/ mail server for the SMTP entry in
php.ini.

Try putting in SMTP the same server you have for your mail client
(Outlook Express????) and in sendmail_from an address for that server,
eg:

SMTP = example.com
sendmail_from = us**@example.com
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Jul 17 '05 #3

P: n/a

Pedro Graca wrote:
Karuna wrote:
I have been trying to write a simple mail script using PHP and apache on Windows XP. Eventhough the script is saying that the mail is
successfully sent, I am unable get it in my mailbox(I have given my
mail address in $to). I am using the mail() function and I have made the following changes in php.ini

[mail function]
; For Win32 only.
SMTP = localhost

smtp_port = 25

; For Win32 only.
sendmail_from = aa*@Comcast.net

CAn anybody help me with this?
If you have a SMTP server installed (and correctly configured) on

your machine, you should have no problem with that php.ini.

But ...

I doubt you have a mail server installed on your machine.
You have to specify an /existing/ mail server for the SMTP entry in
php.ini.

Try putting in SMTP the same server you have for your mail client
(Outlook Express????) and in sendmail_from an address for that server, eg:

SMTP = example.com
sendmail_from = us**@example.com
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/ == ** ## !! ------------------------------------------------ !! ## ** == TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>) may bypass my spam filter. If it does, I may reply from another

address!

Are you sure that the mail function return TRUE?

If it is, I found this note on the PHP.net website that said the
following. I hope this helps:

-------------------------------------------
Quote from PHP.net
-------------------------------------------
thomas at nimstad dot com
01-Oct-2004 01:40
Under win32 you must! set sendmail_from in php.ini to solve the
error: "sendmail_from" not set in php.ini or custom "From:" header
missing. Only setting the headers correctly won't do. When set, the
"From:" header will be used :-)
-------------------------------------------
http://us2.php.net/manual/en/function.mail.php
-------------------------------------------

Hope this helps, good luck.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.