Reply to Re: email all users in database help

Your name:

Reply:


Posted by trashed on 02/12/07 11:29

Thanks, that's all there is to it? I thought there would be gobs of code
involved! But I kind of understand what you have.

Is it possible you can post more of that code so I can see how I can
integrate my mail script with it? Would you mind??
I'm not sure how you can but I'm unclear where/how to put it all together.

thanks again for your help


"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:op.tnmu1ya0qnv3q9@misant...
On Mon, 12 Feb 2007 12:08:45 +0100, trashed <ahhhno@.com> wrote:

> I have a guestbook which has a field that basically asks "join mailing
> list?". Can someone please point me to a code snippet somewhere that can
> help me figure out where to start on this? My database (MySQL) already
> collects all the user's contact info and the 'yes or no' response for the
> mailing list question so I'm hoping this is not incredibly difficult to
> do.
> I have a contact form on my site so maybe I can copy/paste that code for
> the
> actual mass mailing function?
>
> thanks!

$result = mysql_query('SELECT `mail` FROM `table` WHERE `mailinglist` =
\'yes\'') or die(mysql_error());
while($row = mysql_fetch_assoc($result){
mail($row['mail'],'This is the title','And here is the text body');
}

Or possibly:

$mails = array();
while($row = mysql_fetch_assoc($result) $mails[] = $row['mail'];
mail('you_own_emailadress@example.com','Title','Text','Bcc:
'.implode(',',$mails));
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация