Solved

send php mail to more than one person.

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

708 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

15 Experts available now in Live!

Get 1:1 Help Now