473,573 Members | 2,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12955

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.o ut.-blake.com> wrote in
message news:bf******** **@slb9.atl.min dspring.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.o ut.-blake.com> wrote in
message news:bf******** **@slb9.atl.min dspring.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.o ut.-blake.com> wrote in
message news:bf******** **@slb9.atl.min dspring.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.o ut.-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
1052
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 item to create a link attribute. Below will help explain. Basically if a <links> tag has an item in it with the same key="X" then I want to create...
6
1975
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 that are simple, yet will tax the processor and the abilities of the languages? Thanks =)
12
2103
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
2180
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
7189
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
3542
by: D | last post by:
Hi all .. how could one test to see if an open relay exists on a specific email server?
3
3968
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 a couple of problems, which I'll try to describe. But this e-mail will only reproduce one of them, in a "short" example. What I'm generally doing...
0
1221
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 now accompanied by metadata in the form set out in the XML Schema Test Suite Framework . The community owes a big "Thank You" to NIST, Sun and...
3
1480
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 working in localserver so i canot test all the function. If you guys have any idea, then please give me site from there i can downloda. Thanks in advance .
0
7741
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7978
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8028
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5252
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2164
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1263
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
987
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.