Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Use PHP to populate a Mailing list from a webpage

10 views
Skip to first unread message

Graham Hobbs

unread,
Apr 16, 2014, 11:26:29 PM4/16/14
to
Hello,

I am at PHP 101 level. I have a webpage that asks a user to enter
their name in one box, email address in another and click send. That's
works OK (almost):-).

I also have created an empty Mailing list 'List-B' in my Mozilla
Thunderbird to which I want to automatically add the email addresses
sent from the webpage.

Here's my question please.

When the page gets back to my PHP pgm, can it add the email address to
my mailing list without manual intervention?

Am not fond of mixing languages, etc so a pure PHP solution would be
appreciated unless design wise not clever.

Have googled, not found anything closely relevant.

Thanks in advance.
Graham Hobbs

Jerry Stuckle

unread,
Apr 16, 2014, 11:42:20 PM4/16/14
to
Your problem us PHP runs on the server; Thunderbird runs on your local
client. Unless they are the same system, there is no way PHP can update
your local Thunderbird mailing list.

Jerry


--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

Arno Welzel

unread,
Apr 17, 2014, 3:34:07 AM4/17/14
to
Graham Hobbs, 2014-04-17 05:26:

> I am at PHP 101 level. I have a webpage that asks a user to enter
> their name in one box, email address in another and click send. That's
> works OK (almost):-).
>
> I also have created an empty Mailing list 'List-B' in my Mozilla
> Thunderbird to which I want to automatically add the email addresses
> sent from the webpage.

This is not possible, since Thunderbird is not running on the same
computer as your website.

Two ideas:

If you want to maintain mailing lists on the server you need software
like Mailman. This can be installed additionally to the webserver and
you can use the command line interface of mailman to add users to
existing mailing lists which will then accept mails using a "virtual"
e-mail address (e.g. "cust...@lists.domain.example").

OR:

Setup an LDAP server and use the LDAP directory as address book in
Thunderbird. From PHP you can then also add members to the LDAP directory.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

Denis McMahon

unread,
Apr 17, 2014, 6:49:44 AM4/17/14
to
On Thu, 17 Apr 2014 09:34:07 +0200, Arno Welzel wrote:

> Graham Hobbs, 2014-04-17 05:26:
>
>> I am at PHP 101 level. I have a webpage that asks a user to enter their
>> name in one box, email address in another and click send. That's works
>> OK (almost):-).
>>
>> I also have created an empty Mailing list 'List-B' in my Mozilla
>> Thunderbird to which I want to automatically add the email addresses
>> sent from the webpage.
>
> This is not possible, since Thunderbird is not running on the same
> computer as your website.
>
> Two ideas:
>
> If you want to maintain mailing lists on the server you need software
> like Mailman. This can be installed additionally to the webserver and
> you can use the command line interface of mailman to add users to
> existing mailing lists which will then accept mails using a "virtual"
> e-mail address (e.g. "cust...@lists.domain.example").

Observation to the OP: If you do this, you will need to ensure that
mailman only sends mail that is genuinely from you somehow, otherwise
there is a risk, if the virtual email address is ver exposed, of spammers
using your server to spam people on your mailing list.

> Setup an LDAP server and use the LDAP directory as address book in
> Thunderbird. From PHP you can then also add members to the LDAP
> directory.

Thunderbird can also import address book data from csv files, but it
doesn't seem to have an easy way to take a group of existing email
addresses and put them in a mailing list :(

--
Denis McMahon, denismf...@gmail.com

The Natural Philosopher

unread,
Apr 17, 2014, 8:56:42 AM4/17/14
to
If the security of the site IS in fact assured you can use PHP to output
a mailto: URL that can contain dozens of mail addresses.

In this case the web server IS the address book.,

A link that says

<a HREF="mailto:To@domain?bcc=recipent@domain,reciepen@domain">Click
here to send mail</a>

is the sort of thing..





--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.

Thomas 'PointedEars' Lahn

unread,
Apr 17, 2014, 10:49:34 AM4/17/14
to
Graham Hobbs wrote:

> I am at PHP 101 level.

Pardon my saying so, but you are at *Internet* 101 level.

> I have a webpage that asks a user to enter their name in one box, email
> address in another and click send. That's works OK (almost):-).
>
> I also have created an empty Mailing list 'List-B' in my Mozilla
> Thunderbird to which I want to automatically add the email addresses
> sent from the webpage.

Not reasonably possible. *Such* a "Mailing list" is maintained client-side.
The Web application processing the user input runs server-side. Also be
sure that you have users confirm from their e-mail accounts that they really
want to subscribe (opt-in).

You appear to have a misconception of the term “mailing list” and its
implementation. What you can maintain in e-mail clients is a distribution
list which is something else. Look up those terms.

> When the page gets back to my PHP pgm, can it add the email address to

pgm?

> my mailing list without manual intervention?

Only if you are maintaining the mailing list or distribution list server-
side.

> Am not fond of mixing languages, etc so a pure PHP solution would be
> appreciated unless design wise not clever.

AFAIK the most common mailing list management software, Majordomo, is
written in Perl.

> Have googled, not found anything closely relevant.

“PHP mailing list” yields a lot of relevant results among the 161'000'000
hits. Indeed, the first hit, ListMessenger, is relevant already.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann

Graham Hobbs

unread,
Apr 17, 2014, 11:15:41 AM4/17/14
to
---
Denis (to you principally, many thanks all),

Msgs rcvd, some understood, some need my looking into but I have a
starting point. A must "I do want the list on my home machine" - that
ends Mailman, right? LDAP idea I need to learn more. CSV seems to be
an answer, I think.

For another system, I have a php pgm running at my ISP's server (the
design/build not altogether my doing (a lot to do with you lot
actually):-) that receives user pages, extracts user filled fields and
emails them to a Pegasus client running on my home machine. A REXX
polls the Pegasus directory 24/7 and deals with each email as it
arrives - no manual intervention whatsoever.

Sounds like I could do exactly the same. I once only create a csv
file, append thereto as emails come in, and at the end of a day
manually import into Thunderbird, empty the csv file ready for a new
set of email addresses - sounds like a goer .. except I don't fully
understand your comments about 'easy way to take a group' - I wouldn't
want to have a bunch of csv files each with one address and have to
manually load into the Mailing list.

Feasible, sensible, any comments welcome but sort of getting away from
php - so Jerry, I know the story! :-))

Graham

Thomas 'PointedEars' Lahn

unread,
Apr 17, 2014, 4:00:17 PM4/17/14
to
Graham Hobbs wrote:

> Denis McMahon wrote:
>> On Thu, 17 Apr 2014 09:34:07 +0200, Arno Welzel wrote:
>>> Setup an LDAP server and use the LDAP directory as address book in
>>> Thunderbird. From PHP you can then also add members to the LDAP
>>> directory.
>>
>> Thunderbird can also import address book data from csv files, but it
>> doesn't seem to have an easy way to take a group of existing email
>> addresses and put them in a mailing list :(
>
> Msgs rcvd, some understood, some need my looking into but I have a
> starting point. A must "I do want the list on my home machine" - that
> ends Mailman, right?

Probably yes, see below.

> LDAP idea I need to learn more. CSV seems to be an answer, I think.

CSV import would mean that your local distribution list’s content (the
“subscribers” of your messages) is never up-to-date. That is why I said
that there is no *reasonable* solution to your problem, considering your
requirements, as LDAP did not occur to me.

As you can read above, LDAP holds the data server-side, too, so not on your
home machine (unless that is the machine the PHP program is running on and
people can access that machine from the outside¹).

As always, instead of asking for solutions to the problems with your
approach, present your initial problem and ask for approaches to solutions.
But probably in a more general newsgroup, unless you seek a PHP solution.

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
___________
¹ strongly recommended against unless in a DMZ
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300...@news.demon.co.uk>

Arno Welzel

unread,
Apr 18, 2014, 2:10:19 AM4/18/14
to
Thomas 'PointedEars' Lahn, 2014-04-17 16:49:

> Graham Hobbs wrote:
>
[...]
>> Am not fond of mixing languages, etc so a pure PHP solution would be
>> appreciated unless design wise not clever.
>
> AFAIK the most common mailing list management software, Majordomo, is
> written in Perl.

Majordomo was once the most common one - but the latest version of
Majordomo is from 2000 and usually you will now use Mailman (written in
Python) or Sympa (written in Perl).

Graham Hobbs

unread,
Apr 18, 2014, 9:52:44 PM4/18/14
to
On Thu, 17 Apr 2014 16:49:34 +0200, Thomas 'PointedEars' Lahn
<Point...@web.de> wrote:

>Graham Hobbs wrote:
>
>> I am at PHP 101 level.
>
>Pardon my saying so, but you are at *Internet* 101 level.
Why? Can't you use PHP to program non-internet tasks?
>
>> I have a webpage that asks a user to enter their name in one box, email
>> address in another and click send. That's works OK (almost):-).
>>
>> I also have created an empty Mailing list 'List-B' in my Mozilla
>> Thunderbird to which I want to automatically add the email addresses
>> sent from the webpage.
>
>Not reasonably possible. *Such* a "Mailing list" is maintained client-side.
>The Web application processing the user input runs server-side. Also be
>sure that you have users confirm from their e-mail accounts that they really
>want to subscribe (opt-in).
>
>You appear to have a misconception of the term “mailing list” and its
>implementation. What you can maintain in e-mail clients is a distribution
>list which is something else. Look up those terms.
>
You're right, Wikipedia tells me 'disribution list' is what I'm after.
Thanks!

>> When the page gets back to my PHP pgm, can it add the email address to
>
>pgm?
If it's not a pgm, what is it?
>
>> my mailing list without manual intervention?
>
>Only if you are maintaining the mailing list or distribution list server-
>side.
>
>> Am not fond of mixing languages, etc so a pure PHP solution would be
>> appreciated unless design wise not clever.
>
>AFAIK the most common mailing list management software, Majordomo, is
>written in Perl.
>
>> Have googled, not found anything closely relevant.
>
>“PHP mailing list” yields a lot of relevant results among the 161'000'000
>hits. Indeed, the first hit, ListMessenger, is relevant already.
>
>
>PointedEars
--- ---
cheers
Graham

Richard Yates

unread,
Apr 19, 2014, 2:26:33 PM4/19/14
to
On Fri, 18 Apr 2014 21:52:44 -0400, Graham Hobbs <gho...@cdpwise.net>
wrote:

>On Thu, 17 Apr 2014 16:49:34 +0200, Thomas 'PointedEars' Lahn
><Point...@web.de> wrote:
>
>>Graham Hobbs wrote:
>>
>>> I am at PHP 101 level.
>>
>>Pardon my saying so, but you are at *Internet* 101 level.
>Why? Can't you use PHP to program non-internet tasks?

You can but you have to have a server with a php interpreter installed
on your computer.

>>> I have a webpage that asks a user to enter their name in one box, email
>>> address in another and click send. That's works OK (almost):-).
>>>
>>> I also have created an empty Mailing list 'List-B' in my Mozilla
>>> Thunderbird to which I want to automatically add the email addresses
>>> sent from the webpage.
>>
>>Not reasonably possible. *Such* a "Mailing list" is maintained client-side.
>>The Web application processing the user input runs server-side. Also be
>>sure that you have users confirm from their e-mail accounts that they really
>>want to subscribe (opt-in).
>>
>>You appear to have a misconception of the term “mailing list” and its
>>implementation. What you can maintain in e-mail clients is a distribution
>>list which is something else. Look up those terms.
>>
>You're right, Wikipedia tells me 'disribution list' is what I'm after.
>Thanks!
>
>>> When the page gets back to my PHP pgm, can it add the email address to
>>
>>pgm?
>
>If it's not a pgm, what is it?

I think he did not know that you meant "pgm" as shorthand for
"program."

Lew Pitcher

unread,
Apr 19, 2014, 3:15:41 PM4/19/14
to
On Saturday 19 April 2014 14:26, in comp.lang.php, "Richard Yates"
<ric...@yatesguitar.com> wrote:

> On Fri, 18 Apr 2014 21:52:44 -0400, Graham Hobbs <gho...@cdpwise.net>
> wrote:
>
>>On Thu, 17 Apr 2014 16:49:34 +0200, Thomas 'PointedEars' Lahn
>><Point...@web.de> wrote:
>>
>>>Graham Hobbs wrote:
>>>
>>>> I am at PHP 101 level.
>>>
>>>Pardon my saying so, but you are at *Internet* 101 level.
>>Why? Can't you use PHP to program non-internet tasks?
>
> You can but you have to have a server with a php interpreter installed
> on your computer.

That's not entirely true.

If you have PHP installed on your local system, you can use it as a
stand-alone scripting language, by invoking it from the commandline.
PHP can read local files for it's language code, or accept code from stdin

~ $ echo '<?php printf("Hello, world\n"); ?>' | php
Hello, world

PHP also has a built-in webserver "for application development purpose",
so a local installation of PHP does not require a separate "server with a
php interpreter installed" to run PHP code.

[snip]

HTH
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

Message has been deleted

Denis McMahon

unread,
Apr 19, 2014, 4:58:39 PM4/19/14
to
On Sat, 19 Apr 2014 11:26:33 -0700, Richard Yates wrote:

> On Fri, 18 Apr 2014 21:52:44 -0400, Graham Hobbs <gho...@cdpwise.net>
> wrote:

>>Why? Can't you use PHP to program non-internet tasks?

> You can but you have to have a server with a php interpreter installed
> on your computer.

You don't have to have any sort of server to run php scripts, you just
need a php interpreter.

--
Denis McMahon, denismf...@gmail.com

Graham Hobbs

unread,
Apr 19, 2014, 9:26:59 PM4/19/14
to
On Sat, 19 Apr 2014 11:26:33 -0700, Richard Yates
- oh right, sorry ..

Jerry Stuckle

unread,
Apr 19, 2014, 9:38:16 PM4/19/14
to
On 4/19/2014 9:26 PM, Graham Hobbs wrote:
> On Sat, 19 Apr 2014 11:26:33 -0700, Richard Yates
>> I think he did not know that you meant "pgm" as shorthand for
>> "program."
> - oh right, sorry ..

Actually, I think he did - but he's being his usual pedantic self.

Thomas 'PointedEars' Lahn

unread,
Apr 21, 2014, 3:29:32 PM4/21/14
to
Lew Pitcher wrote:

> "Richard Yates" wrote:
>> Graham Hobbs wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Graham Hobbs wrote:
>>>>> I am at PHP 101 level.
>>>> Pardon my saying so, but you are at *Internet* 101 level.
>>> Why? Can't you use PHP to program non-internet tasks?
>> You can but you have to have a server with a php interpreter installed
>> on your computer.
>
> That's not entirely true.

More, it is utter nonsense.

> If you have PHP installed on your local system, you can use it as a
> stand-alone scripting language, by invoking it from the commandline.
> PHP can read local files for it's language code, or accept code from stdin
>
> ~ $ echo '<?php printf("Hello, world\n"); ?>' | php
> Hello, world
>
> PHP

5.4+

> also has a built-in webserver "for application development purpose",
> so a local installation of PHP does not require a separate "server with a
> php interpreter installed" to run PHP code.

ACK. However, my point was, of course, that the World Wide Web and e-mail
are different Internet applications, and are both implementing the client-
server model. Assuming that a *public* *Web* *server* could communicate
with an *e-mail* *client* (running on another, *private* machine) shows a
lack of basic Internet knowledge required to arrive at a working
implementation.


PointedEars
--
When all you know is jQuery, every problem looks $(olvable).
0 new messages