473,756 Members | 2,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms sending some blank emails

Hi, I'm validating a form with this ASP but receiving some blank email
responses; does anyone see anything wrong with it?:

function isFormVarExclud ed(thisForm, strToCheck)
{
var strExcludeVars = thisForm.elemen ts["$excludeva rs"].value;
var arrExcludeVars = strExcludeVars. split(",");
for (var j=0; j<arrExcludeVar s.length; j++)
{
if (arrExcludeVars[j] == strToCheck) return true;
}
return false;
}

function getFormVars(thi sForm)
{
var oFormVars = thisForm.elemen ts["$formvars"];
var strPrevVal = "";
oFormVars.value = "";
for (var x=0,objElem=nul l; objElem=thisFor m.elements.item (x); x++)
{
if (!isFormVarExcl uded(thisForm, objElem.name))
{
if (objElem.name != strPrevVal)
oFormVars.value += objElem.name + ",";
}
strPrevVal = objElem.name;
}
oFormVars.value = oFormVars.value .substr(0,oForm Vars.value.leng th-1);
}
Sep 29 '08 #1
2 3762
<ls********@sof tscape.comwrote in message
news:56******** *************** ***********@h2g 2000hsg.googleg roups.com...
Hi, I'm validating a form with this ASP but receiving some blank email
responses; does anyone see anything wrong with it?:

function isFormVarExclud ed(thisForm, strToCheck)
{
var strExcludeVars = thisForm.elemen ts["$excludeva rs"].value;
var arrExcludeVars = strExcludeVars. split(",");
for (var j=0; j<arrExcludeVar s.length; j++)
{
if (arrExcludeVars[j] == strToCheck) return true;
}
return false;
}

function getFormVars(thi sForm)
{
var oFormVars = thisForm.elemen ts["$formvars"];
var strPrevVal = "";
oFormVars.value = "";
for (var x=0,objElem=nul l; objElem=thisFor m.elements.item (x); x++)
{
if (!isFormVarExcl uded(thisForm, objElem.name))
{
if (objElem.name != strPrevVal)
oFormVars.value += objElem.name + ",";
}
strPrevVal = objElem.name;
}
oFormVars.value = oFormVars.value .substr(0,oForm Vars.value.leng th-1);
}
I may as well ask the obvious; is this script on the server or the client?

There isn't anything in your supplied code relating directly to the sending
of e-mails (nor for that matter relating explicitly to server-side code).

How are you sending them? Have you tested for existence of content in the
relevant string(s) immediately prior to sending?

- Bob.
Sep 30 '08 #2
On Sep 29, 8:20*pm, "Bob Milutinovic" <cogni...@gmail .comwrote:
<lstanik...@sof tscape.comwrote in message

news:56******** *************** ***********@h2g 2000hsg.googleg roups.com...


Hi, I'm validating a form with this ASP but receiving some blank email
responses; does anyone *see anything wrong with it?:
function isFormVarExclud ed(thisForm, strToCheck)
{
var strExcludeVars = thisForm.elemen ts["$excludeva rs"].value;
var arrExcludeVars = strExcludeVars. split(",");
for (var j=0; j<arrExcludeVar s.length; j++)
{
if (arrExcludeVars[j] == strToCheck) return true;
}
return false;
}
function getFormVars(thi sForm)
{
var oFormVars = thisForm.elemen ts["$formvars"];
var strPrevVal = "";
oFormVars.value = "";
for (var x=0,objElem=nul l; objElem=thisFor m.elements.item (x); x++)
{
if (!isFormVarExcl uded(thisForm, objElem.name))
{
if (objElem.name != strPrevVal)
oFormVars.value += objElem.name * + ",";
}
strPrevVal = objElem.name;
}
oFormVars.value = oFormVars.value .substr(0,oForm Vars.value.leng th-1);
}

I may as well ask the obvious; is this script on the server or the client?

There isn't anything in your supplied code relating directly to the sending
of e-mails (nor for that matter relating explicitly to server-side code).

How are you sending them? Have you tested for existence of content in the
relevant string(s) immediately prior to sending?

- Bob.- Hide quoted text -

- Show quoted text -
This is on the server. I didn't create it but it looks like a
validator script. The emails I receive (form responses) sometimes have
only []: in the body but some come in filled out properly (contact
info, product interest, etc.). There's also a validator in the HTML
form page:

<script language="javas cript" type="text/javascript">
<!--
function MM_validateForm () { //v4.0
if (document.getEl ementById){
var
i,p,q,nm,test,n um,min,max,erro rs='',args=MM_v alidateForm.arg uments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2];
val=document.ge tElementById(ar gs[i]);
if (val) { nm=val.name; if ((val=val.value )!="") {
if (test.indexOf(' isEmail')!=-1) { p=val.indexOf(' @');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain
an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val) ;
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf(' inRange') != -1) { p=test.indexOf( ':');
min=test.substr ing(8,p); max=test.substr ing(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a
number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is
required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+er rors);
document.MM_ret urnValue = (errors == '');
} }
//-->
</script>

Then there's this in the form tag:

<form action="../../scripts/handleInfoReque st.asp" method="post"
name="info_requ est"
onSubmit="getFo rmVars(document .info_request); MM_validateForm ('name','','R', 'phone','','R', 'email','','Ris Email','state', '','R');return
document.MM_ret urnValue">

which refers to this on the server:

<%@LANGUAGE = "JScript"%>
<%

function showError(descr iption)
{
%>
<html>
<body>
<p>
ERROR: <%=description% >
</p>
</body>
</html>
<%
}

function showHelp()
{
%>
<html>
<body>
Available Parameters: toemail, fromemail, subject, content,
redirectto
</body>
</html>
<%
}

function getFormDataAsMs g(bUseHTML)
{
var dt = new Date();
var crlf = "\r\n";
if (bUseHTML) crlf = "<br>"

var strMailMsg = (dt.getMonth()+ 1) + "/" + dt.getDate() + "/" +
dt.getFullYear( ) +crlf;

var arrFormVars = new String(Request. Form("$formvars ")).split(" ,");
for (i=0; i<arrFormVars.l ength; i++)
{
itemVal = new String(Request. Form(arrFormVar s[i]));
if (bUseHTML)
{
if (itemVal != "undefined" )
strMailMsg += "<b>[" + arrFormVars[i] + "]</b>:&nbsp;" + itemVal +
crlf;
else
strMailMsg += "<b>[" + arrFormVars[i] + "]</b>:&nbsp;" + crlf;
}
else
{
if (itemVal != "undefined" )
strMailMsg += "[" + arrFormVars[i] + "]: " + itemVal + crlf;
else
strMailMsg += "[" + arrFormVars[i] + "]: " + crlf;
}
}
return strMailMsg;
}

function getFormDataAsCS V()

{
var strCSVLine = "";
var arrFormVars = new String(Request. Form("$formvars ")).split(" ,");
for (i=0; i<arrFormVars.l ength; i++)
{
var itemVal = new String(Request. Form(arrFormVar s[i]));
if (itemVal != "undefined" )
{
var re1 = /\"/g;
var re2 = /\r\n/g;
var re3 = /\n/g;
strCSVLine += "\"" + itemVal.replace (re1, "'").replace(re 2, "
").replace( re3, " ") + "\"";
}
else
strCSVLine += "\"\"";
if (i<arrFormVars. length-1) strCSVLine += ",";
}
return strCSVLine;
}
function appendToFile(st rFileName, strContent)
{
if (strFileName == '' || strFileName == undefined) strFileName =
"default.tx t";
strFileName = "d:/Web/WebDB/" + strFileName;

fs = new ActiveXObject(" Scripting.FileS ystemObject");

var bIsNewFile = false;
if (fs.FileExists( strFileName))
f = fs.GetFile(strF ileName);
else
{
bIsNewFile = true;
fs.CreateTextFi le(strFileName) ;
f = fs.GetFile(strF ileName);
}

ts = f.OpenAsTextStr eam("8", "-2");
if (bIsNewFile)
{
ts.WriteLine(ne w String(Request. Form("$formvars ")));
}
ts.WriteLine(st rContent);
ts.Close( );
}

function sendMail(fromem ail, toemail, subject, content)
{
var msg = new ActiveXObject(" CDO.Message");
msg.From = fromemail;
msg.To = toemail;
msg.Subject = subject;
msg.TextBody = content;

Response.Write( "*" + toemail);

msg.Configurati on.Fields("http ://schemas.microso ft.com/cdo/
configuration/smtpserver") = "10.0.4.9";
msg.Configurati on.Fields("http ://schemas.microso ft.com/cdo/
configuration/sendusing") = 2;
msg.Configurati on.Fields.Updat e();
try
{
msg.Send();
}
catch(e)
{
showError("CDO. Message.Send() failed: " + e.description);
return false;
}
return true;
}

var strSubject = new String(Request. Form("$subject" ));
var strToEmail = new String(Request. Form("$toemail" ));
var strRedirectURL = new String(Request. Form("$redirect to"));
var strFileName = new String(Request. Form("$saveas") );

appendToFile(st rFileName, getFormDataAsCS V());
if (sendMail("in** ********@www.so ftscape.com", strToEmail, strSubject,
getFormDataAsMs g(false)))
Response.Redire ct(strRedirectU RL);
%>

Someone said it's a SPAM problem, but IT says there's no indication of
a SPAM problem in the headers of the blank emails.

Thanks much
Nov 11 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4987
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are working with we put these mailshots in the bcc field of the mails. This can sometimes cause a problem as we are getting alot of mails bounced back. I would like to write a script to have these emails sent out individually using the to: field of the...
2
1912
by: Joe | last post by:
Hi, I am sending an email from an asp page. Besides sending an email to sender, I am sending myself a BCC also. Out of 100 emails sent, about 5 recipients received a blank email (no text in subject and body). The BCC of all these emails that I sent to myself were fine. When I send email manually to these 5 recipients they receive it well. I have pasted my code below. Can someone give me a clue as why this could be happening? Is...
2
9241
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
3
1979
by: Steve Thurston | last post by:
Hi, I'm attempting to send emails for the first time using ASP.NET, so I'm hoping there's just a beginner's error going on here for me. But my emails aren't reaching their destination, and I don't know why. My "development" machine is just my home machine. I'm connected to the Internet via an AOL dialup connection. I am running on XP Pro and my IIS server is (apparently) configured
8
4381
by: Frank | last post by:
I think I've confused myself completely here :-) I have used System.Web.Mail, but am not sure if this works with Exchange Server 5.5. I asked the client if they're email server supported SMTP, and got the following reply (exact quote): Exchange 5.5 uses IMS connector for communication between the internal and the external world. IMS is based on SMTP Protocol. For mail flow within the organization Exchange 5.5 uses Message Transfer...
4
3134
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time getting a SMTP script running. While the Drupal feedback module and the new account creation works fine in terms of sending of mails, I am having some problems with the sending of password reminder emails. warning: Cannot modify header information -...
5
2587
by: Daves | last post by:
Hi, I'm using a asp.net 2.0 website to send out emails to users, the amount of which can reach up to 1500 users. Obviously the code sending the emails has to let the client know the mails are being sent out and display some kind of progress indicator. How would you implement this? Back in old asp 3.0 days I had a blank page where code did a Response.Write(.."mail sent"...) for each mail sent, the layout had to be simple because the page...
5
23804
by: Kun | last post by:
i have the following code: ---------------------------------- import smtplib from email.MIMEText import MIMEText fp = open('confirmation.txt', 'rb') msg = MIMEText(fp.read()) From = 'xxxx@xxxx.xxxx.edu'
14
4261
by: jcage | last post by:
Is there any tutorials online for sending email through forms? I can send an email as well as write to my MySQL database from home with the following code but not at work. I think there might be something I'm missing header-wise that keeps me from making this work on my work system. I'm using Apache 1.3, PHP 4.1 (best the IT guys could do though I'm using 5.x at home), and MySQL as the database. Thanks VERY much for any help or...
0
9273
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8712
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7244
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5141
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.