# Sending email using LoadVars and CGI

**URL:** <https://forum.kirupa.com/t/sending-email-using-loadvars-and-cgi/164032>\
**Category:** flash\
**Created:** [September 28, 2005, 3:35am UTC](https://forum.kirupa.com/t/sending-email-using-loadvars-and-cgi/164032 "2005-09-28T03:35:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adminroz](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@adminroz](https://forum.kirupa.com/u/adminroz)\
**Post date:** [September 28, 2005, 3:35am UTC](https://forum.kirupa.com/t/sending-email-using-loadvars-and-cgi/164032/1 "2005-09-28T03:35:39Z")

</div>

Hi There,

I’m am trying to send an email form, from flash to my web hosts cgi scipt (mailgate). I am unsure how to translate the html code given by the host to use in actionscript and where to put the hidden variables to make this work. My action script reads-

stop ();  
function sendForm () {  
my\_lv = new LoadVars ();  
my\_lv.name = \_parent.t1\_2.text;  
my\_lv.company = \_parent.t2\_2.text;  
my\_lv.email = \_parent.t3\_2.text;  
my\_lv.the\_message = \_parent.t4\_2.text;  
my\_lv.send (“[http://mailgate.server-mail.com/cgi-bin/mailgate](http://mailgate.server-mail.com/cgi-bin/mailgate)”,“POST”);  
nextFrame ();  
}  
send\_btn.onRelease = function () {  
if (t1.text == “” || t2.text == “” || t3.text == “” || t4.text == “”) {  
status\_text.text = “Please complete the entire form …”;  
} else {  
status\_text.text = “Thank You. Your message has been sent.”;  
sendForm ();  
}  
};

and the html given is:  
[size=2][font=Arial][color=#0000ff]\<FORM METHOD=“POST” ACTION=“[http://mailgate.server-mail.com/cgi-bin/mailgate](http://mailgate.server-mail.com/cgi-bin/mailgate)”\> \<inpu[/color][/font][font=Arial][size=2][color=#0000ff]t type=hidden name=“recipient” value="[/color][font=Arial][size=2][color=#ff0000]sales@acme.com[/color][/size][/font][font=Arial][size=2][color=#0000ff]"\> \<input type=hidden name=“subject” value="[/color][/size][/font][font=Arial][size=2][color=#ff0000]Enter Subject[/color][/size][/font][font=Arial][size=2][color=#0000ff]"\> \<input type=hidden name=“redirect” value="[/color][/size][/font][font=Arial][size=2][color=#ff0000][http://www.acme.com/feedback.htm[/color][/size][/font][font=Arial][size=2][color=#0000ff]](http://www.acme.com/feedback.htm%5B/color%5D%5B/size%5D%5B/font%5D%5Bfont=Arial%5D%5Bsize=2%5D%5Bcolor=#0000ff%5D)"\> [/color][/size][/font][font=Arial][size=2][color=#0000ff]Your Email address: \<input type=text name=“email”\>\<BR\> Your Full Name: \<input type=text name=“realname”\>\<BR\> Tell me what you think of me? \<TEXTAREA NAME= “comments” ROWS=3 COLS=50\>Type Here\</TEXTAREA\> \<INPUT TYPE=“SUBMIT” VALUE=“Send Comments”\> \</FORM\>[/color][/size][/font][/size][/font][/size]

Currently, if I press submit, it opens another browser window and asks for a recipient to be specified.

Any help would be greatly appriecated. Thanks
