Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

emailing on the fly pages.

Status
Not open for further replies.

boyfromoz

Technical User
Feb 1, 2001
469
AU
I'm building a php/mysql site for a real estate site. Amongst other things has a mailing list, and a list of properties.

People surfing the site can elect to view only vertain types of properties, say, all the houses.

I wish to email a page to all people on the mailing list details of all new properties.

I can create the page that shows the new properties, but how do I email it, so that the page is visible as a web page within say, outlook express?

Has anyone done somthing similar?
 

$to = "emailadressofrecipient" ;
$subject = "ursubject";

$msg = "ur html msg" ;

$headers = "From: fromemail\nReply-To: replytoemail\nContent-Type: text/html; charset=iso-8859-1";
mail("$to", "$subject", "$msg", "$headers");


since ur sending this email to number of people u can loop thru ur record to get the recipient email address to get the value of $to each time.
Also note that if u intend to send images within ur html msg give the abs path like so that it will directly display from ur sever..

hope that will help u

spookie
--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
To save a bit of time you can do the following.

N.B. There are some problems with this on a microsoft platform.

// $email_array contains an array of email addresses

// create list of email addresses seperated by commas
while( list($key, $value) = each ($email_array) )
{
$email_to_list.= $value . ",";
}
if(trim($email_to_list)=="")
{
// no email recipients go to error page
header("location: error.php");
exit;
}
else
{
// remove trailing , in list
$email_to_list = substr($email_to_list,0,-1);
}

$to=""
$header = "From: fromemail\nReply-To: replytoemail\nBcc: " . $email_to_list . "\n\n";
$subject = "ursubject";
$msg = "ur html msg" ;

mail($to, $subject, $msg, $headers);

This will then send 1 email to everyone in the list without including the other peoples addresses (Bcc:Blind Carbon Copy)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top