Solved

send php mail to more than one person.

Posted on 2010-09-21
2
901 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 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

Industry Leaders: 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

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

623 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