Solved

send php mail to more than one person.

Posted on 2010-09-21
2
895 Views
Last Modified: 2012-05-10
I have the code below.

But I would like to send the email also to $eme as well as $em as gathered from the database.
The mail@yahoo needs to remain also.

SO in short three email address. 2 from db results and one hardcoded as is.

how do I code this.
$row    = $db->getNextRow();
	    $bn = $row[$usdTbl['UBNme']];
	    $ct = $row[$usdTbl['Contact']];
	    $ad = $row[$usdTbl['UAddress']];
	    $em = $row[$usrTbl['UE']];
	    $eme = $row[$usrTbl['UE2']];
	    $ph = $row[$usdTbl['UBPhone']];

    	}
// This is what I currently have.
	$to = $em  .", mail@yahoo.com";

Open in new window

0
Comment
Question by:Cheryl Lander
2 Comments
 

Accepted Solution

by:
Coryf88 earned 400 total points
ID: 33731268

$to			= $em . ', ' . $eme . ', mail@yahoo.com';
$subject	= 'E-mail Subject';
$message	= 'Hello, this e-mail was sent from PHP!';
mail($to, $subject, $message, $additional_headers);

Open in new window

0
 
LVL 4

Assisted Solution

by:intrwrks
intrwrks earned 100 total points
ID: 33731288
Check out the mail() function @ http://www.php.net/manual/en/function.mail.php.
$row    = $db->getNextRow();
	    $bn = $row[$usdTbl['UBNme']];
	    $ct = $row[$usdTbl['Contact']];
	    $ad = $row[$usdTbl['UAddress']];
	    $em = $row[$usrTbl['UE']];
	    $eme = $row[$usrTbl['UE2']];
	    $ph = $row[$usdTbl['UBPhone']];

    	}
// This is what I currently have.
	$to = $em .", ". $eme .", mail@yahoo.com";
         mail($to, "Subject", "Email Message Here");

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
This article discusses how to create an extensible mechanism for linked drop downs.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question