473,406 Members | 2,378 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,406 software developers and data experts.

Personalized Email Script

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

Similar topics

12
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I...
2
by: Tyler Lyon | last post by:
I am trying to find a free script that allows a user to register and login to their own personalized page that was automatically created when the user registered. I am creating a website where the...
4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
4
by: John | last post by:
Greetings, all, Several days after adding personalized URLs to my "amazing" collection of "God Loves (yourname)" mazes, it occurred to me that if someone were to create an offcolor term, then...
2
by: Luis E Valencia | last post by:
I want a row of the datagrid with a personalized link. The fields of the link are on the select related to the datagrid the link would be accoiones.aspx?iddireccion=2&idindicador=5 I tried...
1
by: Michael | last post by:
Hello, Does anyone know how to create a personalized url? For example, I would like my site http://www.mysite.com to offer it's users the ablity to create personalized urls like...
4
by: ianbarton | last post by:
Hello all I am trying to setup a feedback form on my webpage using some script provided by my ISP. I really don't know a lot about PHP and it's syntax etc. The feedback form only has 4...
3
by: Pam1234 | last post by:
Hi everyone, This is a broad question but I'm hoping someone can steer me in the right direction. I can write valid xhtml strict in the dark with my eyes shut but I'm a trial-and-error person when...
1
by: Jeff | last post by:
Hey asp.net 2.0 at work we are about to start on a new project. Creating a website. My mananger has created the database. The database has a table holding user information (not that standard...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.