# Sending email with LoadVars using ASP.NET

**URL:** <https://forum.kirupa.com/t/sending-email-with-loadvars-using-asp-net/170820>\
**Category:** flash\
**Created:** [November 29, 2005, 6:52pm UTC](https://forum.kirupa.com/t/sending-email-with-loadvars-using-asp-net/170820 "2005-11-29T18:52:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnyboy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnnyboy/32/1973_2.png) [@johnnyboy](https://forum.kirupa.com/u/johnnyboy)\
**Post date:** [November 29, 2005, 6:52pm UTC](https://forum.kirupa.com/t/sending-email-with-loadvars-using-asp-net/170820/1 "2005-11-29T18:52:32Z")

</div>

Hi there,

I’m having a bit of a problem with the connoction between my flashmovie and a [ASP.NET](http://ASP.NET) mail script.

I have the following actionscript:

```auto
 
var email_lv:LoadVars = new LoadVars();
email_lv.onLoad = function(success) {	
 if (success) {		
  _root.TEST.from_txt.text = "";
  _root.TEST.email_txt.text = "";;
  _root.TEST.message_txt.text = "";
 }
};
_root.TEST.btn.onRelease = function () {
 email_lv.from_txt = _root.TEST.from_txt.text;
 email_lv.email_txt = _root.TEST.email_txt.text;
 email_lv.message_txt = _root.TEST.message_txt.text;
 email_lv.sendAndLoad("tipenven.aspx", email_lv, "POST");
};

```

And the following [ASP.NET](http://ASP.NET) page:

```auto
 
<%@ Page Language="C#" ClassName="WebUserControl3" %>
<%@ Import Namespace="System.Web.Mail" %>
<script runat="server">
  private void send_msg(object sender, System.EventArgs e)
	 {
   string from_txt = Request.Form["from_txt"];
   string email_txt = Request.Form["email_txt"];
   string message_txt = Request.Form["message_txt"];
   
   MailMessage mailMsg = new MailMessage();
		 mailMsg.From = "kontakt@plusidentity.dk";
		  mailMsg.To = email_txt;
		 mailMsg.Subject = from_txt + " sender dig en julehilsen.";
		 mailMsg.Body = message_txt;
		 mailMsg.Body += from_txt + " Siger:<br>";
		 mailMsg.Body += "<br>-------------------<br>";
		 mailMsg.Body += "<a href='http://www.dengodejul.dk'>www.dengodejul.dk</a>";
   mailMsg.BodyFormat = MailFormat.Html;
  
   SmtpMail.SmtpServer = "backup-mx.zitcom.dk";
		 SmtpMail.Send(mailMsg);
	 }
</script>

```

My problem is, that there is no connection between the to scripts, and the actionscript never goes inti the “succes” and resets the textfields…

I’ve attached the files I’m working on…

Am I missing something??:puzzle:

/JBOY
