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
Solved

send php mail to more than one person.

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to count occurrences of each item in an array.

829 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