sending emails containing dynamic content

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

sending emails containing dynamic content

Post by hame22 »

Hi

I am looking to set up an email mailing list system to send a newsletter automatically once a week.

I am currenly looking at phplists application to manage this.

What I would like to know is the best way to send an email that will contain dynamicaly generated content, (the newsletter contains regularly uodated news). How do i include this php generated content into an email, at present when I copy the emails code into an email all php content is missing.

I hope this is understandable, thanks i advance
illmapu
Forum Commoner
Posts: 47
Joined: Fri Aug 22, 2003 1:48 pm

Post by illmapu »

Hi,

I think I understand....hehe...I thought I'd try to help someone since someone helped me today... :D

I think you should be able to run a simple query to where the info is stored then call to it...So, lets say you have it in field 'body', when you send the email it calls to the body info.

Code: Select all

$check=mysql_query("select * from list");
$data = mysql_fetch_array($check);
$domain_email=$data[domain_email];
$newssubject=$data[newssubject];
$body=$data[body];
Then I would run a cronset for the weekly mailer.

Code: Select all

mail("$domain_email", "$newssubject", "Hi $name,
			
			$body
Hope I helped? hehe
Post Reply