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

Personalized Email Script

P: n/a
I'm posting in desperation and hopes that someone has a script that will
achieve these objectives:

1. Web interface using forms collects Name, Address, Email Address.
2. Web interface sends this info to a PHP script.
3. PHP script has pre-entered text.
4. Name, Address, and Email Address are appended to the END of the
outgoing email message.
5. The outgoing email address shows the "From" as the Email Address.
6. THE PROBLEM: The PHP script has 55 pre-entered email addresses. The
script sends the email individually to each of the 55 people pre-entered
such that the To: line contains only one email address.

Help! Anybody got such a script? I tried writing one, but I'm not even a
Newbie yet, so I did not have any success.

I tried using MailMan for the distribution, which works fairly well, but
the To: line includes some garbage, like "Sent by <listname> on behalf
of <originalsender>".
Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
I noticed that Message-ID:
<d5******************************@news.teranews.co m> from mcp6453
contained the following:
6. THE PROBLEM: The PHP script has 55 pre-entered email addresses. The
script sends the email individually to each of the 55 people pre-entered
such that the To: line contains only one email address.

Help! Anybody got such a script? I tried writing one, but I'm not even a
Newbie yet, so I did not have any success.


Try again, it's pretty easy.

//Put your addresses in an array

//e.g.

$addresses=array("address1", "address2", "address_n")

//Then set up subject

$subject ="some subject";

//The message...

$message="some message \n";

//Add the POSTed stuff

$message.=$_POST['name']."\n";
$message.=$_POST['address']."\n";
$message.=$_POST['email']."\n";

Then loop through them to send the mails

for($i=0;$i<count($addresses);$i++){

mail($addresses[$i],$subject,$message);
}

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

P: n/a
Geoff Berrow wrote:
Then loop through them to send the mails

for($i=0;$i<count($addresses);$i++){

mail($addresses[$i],$subject,$message);
}


I prefer:

foreach ($addresses as $addr) {
mail($addr, $subject, $message);
}

:-)

--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #3

P: n/a
Pedro Graca wrote:

Geoff Berrow wrote:
Then loop through them to send the mails

for($i=0;$i<count($addresses);$i++){

mail($addresses[$i],$subject,$message);
}


I prefer:

foreach ($addresses as $addr) {
mail($addr, $subject, $message);
}

Thanks to both of you for posting this solution. I wondered about using
foreach!
Jul 17 '05 #4

P: n/a
mcp6453 wrote:
6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
The script sends the email individually to each of the 55 people
pre-entered such that the To: line contains only one email address.

Use BCC: instead of To:

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 17 '05 #5

P: n/a
Brian wrote:
mcp6453 wrote:
6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
The script sends the email individually to each of the 55 people
pre-entered such that the To: line contains only one email address.

Use BCC: instead of To:


The use of BCC only may result in your email being tossed as a number of
companies do not allow BCC-only (nothing in the To: field) to be
processed as it is generally considered SPAM.

Michael Austin.
Jul 17 '05 #6

P: n/a
Michael Austin wrote:
Brian wrote:
Use BCC: instead of To:


The use of BCC only may result in your email being tossed as a
number of companies do not allow BCC-only (nothing in the To:
field) to be processed as it is generally considered SPAM.


I didn't know that. I suppose you could put a dummy item in the to:
field. That's the way Pine worked, IIRC. I mailed playlists to record
labels using e.g.,
To: Program Playlists
Bcc: la***@example.com

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 17 '05 #7

P: n/a
On Wed, 07 Jul 2004 01:05:19 GMT, Michael Austin
<ma*****@firstdbasource.com> calmly ranted:
Brian wrote:
mcp6453 wrote:
6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
The script sends the email individually to each of the 55 people
pre-entered such that the To: line contains only one email address.

Use BCC: instead of To:


The use of BCC only may result in your email being tossed as a number of
companies do not allow BCC-only (nothing in the To: field) to be
processed as it is generally considered SPAM.


Can't you use your own address (or a default address) in the
To: field and then send the rest to BCC:?
----------------------------------------------
Never attempt to traverse a chasm in two leaps
http://www.diversify.com Comprehensive Website Design
================================================== =========

Jul 17 '05 #8

P: n/a
On Tue, 06 Jul 2004 20:56:41 -0700, Larry Jaques
<novalidaddress@di\/ersify.com> wrote:
On Wed, 07 Jul 2004 01:05:19 GMT, Michael Austin
<ma*****@firstdbasource.com> calmly ranted:
Brian wrote:
mcp6453 wrote:

6. THE PROBLEM: The PHP script has 55 pre-entered email addresses.
The script sends the email individually to each of the 55 people
pre-entered such that the To: line contains only one email address.

Use BCC: instead of To:


The use of BCC only may result in your email being tossed as a number of
companies do not allow BCC-only (nothing in the To: field) to be
processed as it is generally considered SPAM.


Can't you use your own address (or a default address) in the
To: field and then send the rest to BCC:?


He could use php to send one message to a Majordomo Listserv and have
the listserve expand the names. Each user would get their own and the
majordomo list would be easily updatable.
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #9

P: n/a
Hello,

On 07/07/2004 12:32 AM, Brian wrote:
The use of BCC only may result in your email being tossed as a
number of companies do not allow BCC-only (nothing in the To:
field) to be processed as it is generally considered SPAM.

I didn't know that. I suppose you could put a dummy item in the to:
field. That's the way Pine worked, IIRC. I mailed playlists to record
labels using e.g.,
To: Program Playlists
Bcc: la***@example.com


That is not the problem. The problem is that the messages are discarded
if the actual recipient that you set in Bcc: is not in a visible header
(To: or Cc:) denoting that the message was not really for the recipient
but rather some bulk mailing.

Hotmail started classifying messages like this as spam, depending on the
filtering level, which is bad because it affects messages sent to
mailing lists.

If you really want to reach Hotmail users and of other systems that make
this kind of filtering you have no choice than sending separate
messages to each of them.

Since you do not want to personalize the messages, you may want to try
this class that can compose and send messages. It comes with a feature
of caching messages between deliveries to avoid regenerating the message
body while you can still change the To: header for each recipient.

http://www.phpclasses.org/mimemessage

Bulk mailing is an heavy task but at least you can save some time
optimizing some heavy parts.

There are other types of optimizitions but those depend on the mail
system that you use. Just mail me privately so I can tell you more on
this without having you to disclose unnecessary details in public.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.