User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion

Reply
Thread Tools Display Modes
Unread 1 Feb 2006, 17:06   #1
Smudge
For Crowly <3
 
Smudge's Avatar
 
Join Date: Aug 2003
Location: Luton, England
Posts: 1,391
Smudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond repute
PHP/MySQL and Mail Merge

Lo all,

I've got a database which has email addresses in and I need to be able to mail merge and send out to those email address. I have to do it using PHP/MySQL and I havn't got a clue. Any pointers?

Cheers
__________________
[14:53:26] * Keiz`afk has joined #support
[14:53:36] <Keiz`afk> THE SMUDGE CHEERLEADING TEAM HAS ARRIVED
Smudge is offline   Reply With Quote
Unread 1 Feb 2006, 19:17   #2
SYMM
Love's Sweet Exile
 
SYMM's Avatar
 
Join Date: May 2001
Location: Living on a Stair (Now Sword-less)
Posts: 2,371
SYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better place
Re: PHP/MySQL and Mail Merge

Code:
///do all your db connecty stuff
//you'll have a template stored somewhere,
$mail= ' Dear {name}, blah blah';
$q = 'SELECT email, name FROM table';
$rs=mysql_query($q);
$subject='Subject Here';
while($row=mysql_fetch_assoc($rs)) {
  $to=$row['email'];
  $body=str_replace('{name}',$row['name'],$template);
  mail($to,$subjet,$body);
}
Would be thebasic format of it, but there are plenty of existing things you could use outthere/...
__________________
--SYMM--
Ba Ba Ti Ki Di Do
SYMM is offline   Reply With Quote
Unread 1 Feb 2006, 20:43   #3
Smudge
For Crowly <3
 
Smudge's Avatar
 
Join Date: Aug 2003
Location: Luton, England
Posts: 1,391
Smudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond reputeSmudge has a reputation beyond repute
Re: PHP/MySQL and Mail Merge

Many thanks
__________________
[14:53:26] * Keiz`afk has joined #support
[14:53:36] <Keiz`afk> THE SMUDGE CHEERLEADING TEAM HAS ARRIVED
Smudge is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 23:37.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018