Page 1 of 1

sending emails containing dynamic content

Posted: Mon Jan 08, 2007 4:43 am
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

Posted: Tue Jan 09, 2007 2:26 pm
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