Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

send php mail to more than one person.

Posted on 2010-09-21
2
Medium Priority
?
904 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 1600 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

877 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