# Sending multiple emails

**URL:** <https://forum.kirupa.com/t/sending-multiple-emails/321279>\
**Category:** Uncategorized\
**Created:** [April 14, 2011, 8:53pm UTC](https://forum.kirupa.com/t/sending-multiple-emails/321279 "2011-04-14T20:53:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hooko22](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@hooko22](https://forum.kirupa.com/u/hooko22)\
**Post date:** [April 14, 2011, 8:53pm UTC](https://forum.kirupa.com/t/sending-multiple-emails/321279/1 "2011-04-14T20:53:05Z")

</div>

Hoping you guys could help me with this. I have as3 in a fla and I have a php script on my server sending the mail after being sent a variable from flash. I have no difficulty getting this working but the problem is I need it to send to two adresses, one which the user types in a text box with id email\_txt and then I wanted to add my email as well so it sent both to the adress the user types in and to mine?

var note:String;  
var variables:URLVariables = new URLVariables();  
var mailAddress:URLRequest = new URLRequest(“[http://www.email.com/email.php](http://www.email.com/email.php)”);

send\_btn.addEventListener(MouseEvent.CLICK, onSubmit);

function onSubmit(e:Event):void {

variables.sEmail = email\_txt.text + “[email@gmail.com](mailto:email@gmail.com)”;

variables.sMessage = note\_txt.text;  
variables.sName = “”;  
variables.sSend = “Razor”;

note = date\_txt.text + "  
" + namep\_txt.text +"  
" + user\_txt.text +"  
" +hotel\_txt.text +"  
" +note\_txt.text;  
variables.sMessage = note;

variables.sSubject = “Rezidor job Form.”  
mailAddress.data = variables;  
mailAddress.method = URLRequestMethod.POST;  
sendToURL(mailAddress);

}

send\_btn.addEventListener(MouseEvent.CLICK, onPrint)

* * *

\<?php  
$sendTo = $\_POST[“sEmail”];

$subject = $\_POST[“sSubject”];  
$headers = "From: " . $\_POST[“sName”].= “\<” . $\_POST[“sSend”] . "\>  
";  
$headers .= “\<” . $\_POST[“email”] . "\>  
";  
$headers .= "Reply-To: " . $\_POST[“sEmail”] . "  
";

$headers .= "Return-path: " . $\_POST[“sEmail”];

$message = $\_POST[“sMessage”];

mail($sendTo, $subject, $message, $headers);

mail($sendTo, $subject, $message, $headers);

?\>

* * *

I’ve tried this and that and nothing seems to work.

I know the problem is somewhere with this line:  
variables.sEmail = email\_txt.text + “[[COLOR=#0066cc]email@gmail.com[/COLOR]](mailto:email@gmail.com)”;  
I tried changing it to = variables.sEmail = email\_txt.text + “[[COLOR=#0066cc]email@gmail.com[/COLOR]](mailto:email@gmail.com)”;

and

variables.sEmail = “email\_txt.text + [[COLOR=#0066cc]email@gmail.com[/COLOR]](mailto:email@gmail.com)”;

even tried

variables.sEmail = email\_txt.text + &[EMAIL=“email@gmail.com”][COLOR=#0066cc]email@gmail.com[/COLOR][/EMAIL];

I have also tried changing the php.

Made a new variable called email2 and introduced it to the php. Nothing seems to work.

Thanks guys for reading.
