Click to See Complete Forum and Search --> : Customizing Contact.asp


StaceyB
11-16-2009, 01:07 PM
Hi! I am customizing a asp script for a contact form from a flash template. In testing, when I fill out the form and hit submit, my emails are routing. There's only 3 fields on my contact form but the field "your_email" is appending &777&Email at the end of the email address.
For the life of my I cannot understand where it's coming from. Here's my contact.asp code:


<%

Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")

Dim Flds
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds( _
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") _
= "c:\inetpub\mailroot\pickup"
Flds.Update

Set iMsg.Configuration = iConf
iMsg.To = Request.Form.Item("your_email")
iMsg.From = "myaddress@mydomain.com"
//iMsg.Subject = Request.Form.Item("your_name")
//iMsg.TextBody = Request.Form.Item("message")
iMsg.Send

%>

Is it the smtpserverpickupdirectory?? I know it's something stupid.. but I can't see it.

Please help!

yamaharuss
11-16-2009, 01:36 PM
What do you get when you

response.write(Request.Form.Item("your_email"))
response.end


before your mail code?

StaceyB
11-16-2009, 01:46 PM
Hi! When I do this I get:

whatever I entered in the form + &777 (ie. jdoe@aol.com&777)

yamaharuss
11-16-2009, 01:47 PM
Show us the code for your form

StaceyB
11-16-2009, 02:10 PM
onSelfEvent (load){
recipient = _root.recipient;
_root.serv = _root.server_option;
_parent.fields_descriptions = Array("", Array("t1", "your_name", "Name"), Array("t2", "your_email", "Email"), Array("t3", "message", "Message"), Array("t4", "phone", "Phone"), Array("t5", "fax", "Fax"), Array("t6", "address", "Address"));
for (i=1; i<=_parent.fields_descriptions.length; i++) {
this['t'+i].text = _parent.fields_descriptions[i][2];
}
}

//here's the script on the fields I'm using.
onSelfEvent (load){
this._text.onSetFocus = function() {
if (this.text == "Name") {
this.text = "";
} else {
this.text = this.text;
}
_parent.stat.gotoAndPlay("Name");
};
this._text.onKillFocus = function() {
if (this.text == "") {
this.text = "Name";
} else {
this.text = this.text;
}
};
}

onSelfEvent (load){
this._text.onSetFocus = function() {
if (this.text == "Email") {
this.text = "";
} else {
this.text = this.text;
}
_parent.stat.gotoAndPlay("Email");
};
this._text.onKillFocus = function() {
if (this.text == "") {
this.text = "Email";
} else {
this.text = this.text;
}
};
}
onSelfEvent (load){
this._text.onSetFocus = function() {
if (this.text == "Message") {
this.text = "";
} else {
this.text = this.text;
}
_parent.stat.gotoAndPlay("msg");
};
this._text.onKillFocus = function() {
if (this.text == "") {
this.text = "Message";
} else {
this.text = this.text;
}
};
}
//here's the script on the submit button
on (rollOver) {
gotoAndPlay("s1");
}
on (rollOut,releaseOutside){;
gotoAndPlay("s2");
}
on (release) {
for (i=1; i<_parent._parent.fields_descriptions.length; i++) {
if (_parent[_parent._parent.fields_descriptions[i][0]].text != "") {
this[_parent._parent.fields_descriptions[i][1]] = _parent[_parent._parent.fields_descriptions[i][0]].text+"&777&"+_parent._parent.fields_descriptions[i][2];
this[_parent.fields_descriptions[i][0]].text = _parent.fields_descriptions[i][2];
}
}
delete (i);
this.recipient = _parent.recipient;
getURL("contact."+_root.serv, "_blank", "POST");
}

OHHH, I think I know. Is it the array of these other fields I'm not using??

StaceyB
11-16-2009, 03:55 PM
Ok, my code is actually pointing to the wrong fields. I have the To and From fields mixed up. However, when I change it, it no longer sends the email....

*Pulling out my hair!!!*

I think it should be like this. But no email are routed...
<%

Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")

Dim Flds
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds( _
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") _
= "c:\inetpub\mailroot\pickup"
Flds.Update

Set iMsg.Configuration = iConf
iMsg.To = "myaddress@mydomain.com"
iMsg.From = Request.Form.Item("your_email")
iMsg.Subject = "Inquiry from website"
iMsg.TextBody = Request.Form.Item("message")
iMsg.Send

%>