Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

send php mail to more than one person.

Posted on 2010-09-21
2
Medium Priority
?
903 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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 …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

688 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