Solved

send php mail to more than one person.

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now