Forum Moderators: coopster

Message Too Old, No Replies

Can PHP do?

Mailing lists and Search for Web site using PHP?

         

anshul

6:33 am on Mar 29, 2005 (gmt 0)

10+ Year Member



I've few doubts; I'm asking two problem here.

1st, can we use PHP for maintaining mailing-lists. Say, we've 1000 users, need be e-mailed a subscription newsletter i.e. $message is same, loop through e-mail array in db.
2nd, Web site search. We maintain database after reading files using PHP and manipulate results from db.

Question is, if PHP is a solution for these problems, also, when users' ( 1 ), keywords' ( 2 ) dbs grow big! There is also a limit of a PHP script execution. In 1st case, PHP has to parse, suppose 10k subscribers, and generate 10k e-mail for sendmail program.

Is PHP feasible for such things.
What else, is a better and professionally used solution.
I don't know CGI? Perl?

Please discuss.

wrightee

6:59 am on Mar 29, 2005 (gmt 0)

10+ Year Member



Yep; php can do all that with its eyes closed. There are hundreds of scripts that do it already too; check out any of the major script sites, might save you some time.

anshul

7:20 am on Mar 29, 2005 (gmt 0)

10+ Year Member



I prefer to write PHP myself for these two problems.
Question is if Perl/CGI better ( I guess! )?
What's the professional trend?

Please discuss in detail NOW.

dcrombie

12:28 pm on Mar 29, 2005 (gmt 0)



If you want to send the same email to 1-10,000 recipients then PHP is a good enough way to do it.

But if you need to send a 'personalised' email to each user then you might have problems with your mail server clogging up and PHP timing out - in that case I'd look at using a third-party site.

coopster

3:01 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



PHP will handle it, but you may want to consider your logic/control structure and volume of sends...


Note: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.

For the sending of large amounts of email, see the PEAR::Mail, and PEAR::Mail_Queue packages.

Resouce: mail() [php.net]

Granted, you could roll your own code to open the socket, etc., but this a case where the PEAR classes come in handy as the legwork has already been done for you.

anshul

6:40 pm on Mar 29, 2005 (gmt 0)

10+ Year Member



I'm discussing mailing-list; obviously each user will be e-mailed same subscription.

If PHP PEAR::mail is same efficient as .cgi script, it's fine to use it. So, I assume call to such PHP script will generate 10k e-mail for sendmail program to parse!? Please tell how to e-mail ( test ) using PEAR on localhost/IIS.

My phpinfo() is showing
Configuration
PHP Core
include_path .;c:\php4\pear .;c:\php4\pear
I fear, PEAR is not configured properly.

PHPList is also a pouplar readymade solution, but I write custom script myself. Thanx.

coopster

11:38 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have never installed PEAR on IIS, but the PEAR installation steps are fairly straightforward. If I was going to do it myself, I would start here

[pear.php.net...]

anshul

6:52 am on Mar 31, 2005 (gmt 0)

10+ Year Member



Still the good questions:

If a PHP script generate 10k e-mail for sendmail program; it'll be really a nonsense or it may not be permitted by Web host provider. So, we may need generate e-mail in batches; how? Also can someone tell the trick to send mail attachments.

2nd question remains unanswered: If Web site search can be done using PHP file-system functions and a db.

Answers will add to the benefit of all members :);)

anshul

11:29 am on Apr 25, 2005 (gmt 0)

10+ Year Member



So, I installed PEAR on localhost; set include_path as c:\php\pear\

One question, I've is what is meant by PEAR installation. If it is all about includes and requires of class definitions. What'll it mean on remote server ( shared hosting; shared PHP installation )? include_path for my remote server is

.:/usr/lib/php:/usr/local/lib/php

There is no PEAR directory, I see; I'm little confused.
I think I've upload MAIL & MAIL_QUEUE packages to public_html; so that I can use PEAR! Then what's is PEAR installation all about?

coopster

2:58 am on Apr 27, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Most installations include the PEAR packages, but obviously not all. You can still install them into your own user space if your host allows it. If not, maybe time to get a new host ;)