473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How can I test php mail?

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
7 12949

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
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
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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bjam | last post by:
Hi, basically I am trying to create the following logic in an xsl style sheet, which is: if a similar node with the same key name exists in the another section of the file, I will use that data...
6
by: trentdk | last post by:
I want to test which language (testing C and FORTRAN) would be faster with math calculations; one test with intergers, and another test with floats. What math formulas/functions would you guys use...
12
by: news.fe.internet.bosch.com | last post by:
Hi All , I u find out size of struct , does it considers paddding chars into consideration struct A { char c; int i; };
1
by: Robert V. Hanson | last post by:
Please give me some ideas on how to setup the ability to test System.Web.Mail code to send emails using just my development computer, Win2000Pro OS and IIS5.0? Thanks, Bob Hanson
6
by: SevDer | last post by:
Is there a way to test guid string? I want to do it without try catch block to save on performance. Thanks in advance. -- SevDer
8
by: D | last post by:
Hi all .. how could one test to see if an open relay exists on a specific email server?
3
by: jab3 | last post by:
Hello. I"m new to this group, and to JavaScript in general, so please forgive me if I breach local etiquette. I'm trying to implement some client-side 'dynamic' validation on a form. I'm having...
0
by: Henry S. Thompson | last post by:
Thanks to contributions from Microsoft and Sun updating and considerably extending their 2002 contributions, we now have nearly 40,000 tests for W3C XML Schema 1.0 2nd edition. All the tests are...
3
by: robin1983 | last post by:
Hi guys, I want to know is there any software with that i can test my mail function at any time in my local system. Actually, I m using Wamp and some time I need to test mail() function. As i m...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.