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

How can I test php mail?

P: n/a
This may be OT a bit, so maybe someone can point me in the right direction.

I want to test a script that sends out an e-mail. I want to test it locally
on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want to
test it.

Is there something I need to do in order to test locally? Do I have to set up
an SMTP server? Is that hard? Anything else needs to be done? CAN any of this
be done... or is it worth the trouble?

Thanks for any pointers.

Al

Jul 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

For PHP/Apache to send emails, you only have to have a working SMTP service
on your Linux box. You should, in theory, be able to run it locally if you
can send mail using "sendmail" command in linux.

The issues you could run into are:

1. Your ISP blocks you from sending mail other than via their SMTP server
(this is a new trend).
2. You may have to configure your firewall settings on your Linux box.
3. Your hosting company, pair.com, may use a different version of SMTP,
different firewall settings, or other differences that could cause things
that work at home to not work there, etc.

If you already have apache and php working at home, just give it a try. If
it fails, then focus on configuring SMTP and test with the sendmail command
until that works. Then you should be in business.

Jerry
"Adams-Blake Co." <at************@adams.takeme.out.-blake.com> wrote in
message news:bf**********@slb9.atl.mindspring.net...
This may be OT a bit, so maybe someone can point me in the right direction.
I want to test a script that sends out an e-mail. I want to test it locally on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want to test it.

Is there something I need to do in order to test locally? Do I have to set up an SMTP server? Is that hard? Anything else needs to be done? CAN any of this be done... or is it worth the trouble?

Thanks for any pointers.

Al

Jul 16 '05 #2

P: n/a
Well, I think Mandrake installs and configures a SMTP server, so it
should already be working. Otherwise, you can place your ISP's SMTP
server in your php.ini configuration.

Adams-Blake Co. wrote:
This may be OT a bit, so maybe someone can point me in the right direction.

I want to test a script that sends out an e-mail. I want to test it locally
on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want to
test it.

Is there something I need to do in order to test locally? Do I have to set up
an SMTP server? Is that hard? Anything else needs to be done? CAN any of this
be done... or is it worth the trouble?

Thanks for any pointers.

Al


Jul 16 '05 #3

P: n/a
Louis-Philippe Huberdeau wrote:
Well, I think Mandrake installs and configures a SMTP server, so it
should already be working. Otherwise, you can place your ISP's SMTP
server in your php.ini configuration.

Adams-Blake Co. wrote:
This may be OT a bit, so maybe someone can point me in the right direction.

I want to test a script that sends out an e-mail. I want to test it locally
on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want
to test it.

Is there something I need to do in order to test locally? Do I have to set
up an SMTP server? Is that hard? Anything else needs to be done? CAN any of
this be done... or is it worth the trouble?

Thanks for any pointers.

Al


Hmmm. If there is an SMTP server installed, I don't know about it. How could
I tell?
Otherwise, you can place your ISP's SMTP
server in your php.ini configuration.


I can? Where? This would be the easiest solution.... to put the address of
Mindspring there. I'll check out the php.ini but can you give me a hint as to
which (of the many) parms it is?

Thanks,
Al
Jul 16 '05 #4

P: n/a
"Adams-Blake Co." <at************@adams.takeme.out.-blake.com> wrote in
message news:bf**********@slb9.atl.mindspring.net...
This may be OT a bit, so maybe someone can point me in the right direction.
I want to test a script that sends out an e-mail. I want to test it locally on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want to test it.

Is there something I need to do in order to test locally? Do I have to set up an SMTP server? Is that hard? Anything else needs to be done? CAN any of this be done... or is it worth the trouble?

Thanks for any pointers.

Al


If you dont have sendmail instaled and/or dont want to install there is a
free perl sendmail wrapper available from --
http://www.elbtec.de/download/sendmail.php4
just tell your php.ini file where to find it and give it your isp's smtp
details,

just an option.?
Jul 16 '05 #5

P: n/a
I don't know the exact name but searching for smtp in the file will lead
you close to it, read the comments. The value is probably set to
localhost right now (default value).

Adams-Blake Co. wrote:
Louis-Philippe Huberdeau wrote:

Well, I think Mandrake installs and configures a SMTP server, so it
should already be working. Otherwise, you can place your ISP's SMTP
server in your php.ini configuration.

Adams-Blake Co. wrote:
This may be OT a bit, so maybe someone can point me in the right direction.

I want to test a script that sends out an e-mail. I want to test it locally
on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want
to test it.

Is there something I need to do in order to test locally? Do I have to set
up an SMTP server? Is that hard? Anything else needs to be done? CAN any of
this be done... or is it worth the trouble?

Thanks for any pointers.

Al


Hmmm. If there is an SMTP server installed, I don't know about it. How could
I tell?

Otherwise, you can place your ISP's SMTP
server in your php.ini configuration.

I can? Where? This would be the easiest solution.... to put the address of
Mindspring there. I'll check out the php.ini but can you give me a hint as to
which (of the many) parms it is?

Thanks,
Al


Jul 16 '05 #6

P: n/a
Jamie C wrote:
"Adams-Blake Co." <at************@adams.takeme.out.-blake.com> wrote in
message news:bf**********@slb9.atl.mindspring.net...
This may be OT a bit, so maybe someone can point me in the right

direction.

I want to test a script that sends out an e-mail. I want to test it

locally
on my Mandrake Linux 8.2 box.

It runs OK on my host (pair.com) but I have to upload it each time I want

to
test it.

Is there something I need to do in order to test locally? Do I have to set

up
an SMTP server? Is that hard? Anything else needs to be done? CAN any of

this
be done... or is it worth the trouble?

Thanks for any pointers.

Al


If you dont have sendmail instaled and/or dont want to install there is a
free perl sendmail wrapper available from --
http://www.elbtec.de/download/sendmail.php4
just tell your php.ini file where to find it and give it your isp's smtp
details,

just an option.?

I'll try it out, but I think I have sendmail installed. What does this tell
you?

[al@localhost al]$ su
Password:
[root@localhost al]# sendmail -bp
sendmail: warning: Mail system is down -- accessing queue directly
Mail queue is empty
[root@localhost al]# exit

So maybe I just need to change the php.ini to where the sendmail program is?

Thanks,

Al
Jul 16 '05 #7

P: n/a
On Sat, 19 Jul 2003 16:16:41 -0700, "Adams-Blake Co."
<at************@adams.takeme.out.-blake.com> wrote:
I'll try it out, but I think I have sendmail installed. What does this tell
you?

[al@localhost al]$ su
Password:
[root@localhost al]# sendmail -bp
sendmail: warning: Mail system is down -- accessing queue directly
That looks a lot like you actualy have the Postfix mail server (which
personally I prefer to sendmail). It installs aliases so that it can be a
drop-in replacement for sendmail.

Try the following:

which postfix

If this prints out a path to the postfix executable (e.g. /usr/sbin/postfix),
then try:

postfix start

This may bring your mail system up. Or it may not - it's probable that you
have to do some minor configuration steps first; I don't know how
pre-configured it will be on your particular distribution of Linux.

Postfix's homepage is at:

http://www.postfix.org/

Configuration information at:

http://www.postfix.org/basic.html
Mail queue is empty
[root@localhost al]# exit

So maybe I just need to change the php.ini to where the sendmail program is?


May not need to bother; need to start up the mail system first. If it still
doesn't work, then yes, try filling in the sendmail_patch configuration
variable.

A word of caution; if your Linux machine is connected directly to the
Internet, you should take care that your mail server is not an 'open relay', as
these are used by spammers to do their dirty deeds. Postfix is by default
closed to addresses outside your local network, so should be safe.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.