lshane
asked on
ASP JAVASCRIPT SYNTAX FOR A LINE BREAK OR CARRIAGE RETURN IN AN E-MAIL MEMO FIELD
Hello. I would you like some assistance with creating a line break/carriage return in an E-mail MEMO field using ASP JAVASCRIPT, please.
I have the VBSCRIPT version of: MailBody = MailBody + replace(request("bodyMessa ge"), vbcrlf,"<br>");
However, I need the ASP JAVASCRIPT version.
Please help.
Thank you.
I have the VBSCRIPT version of: MailBody = MailBody + replace(request("bodyMessa
However, I need the ASP JAVASCRIPT version.
Please help.
Thank you.
MailBody = MailBody + Request.Form("bodyMessage" ).Value.re place("\n" , "<br>");
ASKER
Hi, amit g. Thanks so much for your response. I tried your string:
MailBody = MailBody + Request.Form("bodyMessage" ).Value.re place("\n" , "<br>");
However, it rendered this error:
Microsoft JScript runtime error '800a138f'
'Value' is null or not an object
/helmsadmin/mailingList.as p, line 73
Here's my code, if it will help any:
-------------------------- ---------- ---------- ---------- ------
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_ rhelms.asp " -->
<%
var rsMailingList = Server.CreateObject("ADODB .Recordset ");
rsMailingList.ActiveConnec tion = MM_conn_rhelms_STRING;
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati on = 2;
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai l/CDONTS_N ewMail_JS. asp" -->
<!--#include file="../WA_Universal_Emai l/MailForm atting_JS. asp" -->
<%
function WA_Universal_Email_1_SendM ail(Recipi entEmail) {
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o rg";
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO bject,Reci pientEmail );
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject," rhelmsmini stries@com cast.net") ;
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj ect,0);
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail Object,"3" );
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "<title>Untitled Document</title>\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\ " content=\"text/html; charset=iso-8859-1\">\r\n" ;
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + Request.Form("bodyMessage" ).Value.re place("\n" , "<br>");
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>\r\n";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec t,MailAtta chments,Ma ilBCC,Mail CC,MailTo, MailImport ance,MailF rom,MailSu bject,Mail Body);
WA_MailObject = null;
}
%>
-------------------------- ---------- ---------- ---------- ---------- -
Thanks again.
MailBody = MailBody + Request.Form("bodyMessage"
However, it rendered this error:
Microsoft JScript runtime error '800a138f'
'Value' is null or not an object
/helmsadmin/mailingList.as
Here's my code, if it will help any:
--------------------------
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_
<%
var rsMailingList = Server.CreateObject("ADODB
rsMailingList.ActiveConnec
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai
<!--#include file="../WA_Universal_Emai
<%
function WA_Universal_Email_1_SendM
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject,"
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "<title>Untitled Document</title>\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + Request.Form("bodyMessage"
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>\r\n";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec
WA_MailObject = null;
}
%>
--------------------------
Thanks again.
Looks like Request.Form("bodyMessage" ).Value is NULL. Check that. You cannot use replace function with a null value
Change
MailBody = MailBody + Request.Form("bodyMessage" ).Value.re place("\n" , "<br>");
To
MailBody = MailBody + (""+Request.Form("bodyMess age").Valu e).replace ("\n", "<br>");
MailBody = MailBody + Request.Form("bodyMessage"
To
MailBody = MailBody + (""+Request.Form("bodyMess
ASKER
Hello, hongjun. Thank you for your reply. I tried your suggestion and the page DOES proceed to the "Success" page, however, it is not being sent to my E-mail server now. Would you, please, mind reviewing 2 file source codes for me and help me identify the difference? The files are named "mailinList.asp" and "mailingList2_TEST.asp". "mailingList2_TEST.asp works perfectly. "mailingList.asp" DOES proceed to the "Success" page, as well, but the message never makes it to the E-mail.
I know the "mailinList.asp" is "JAVASCRIPT" and the "mailingList2_TEST.asp" is "VBSCRIPT". Perhaps you could still identify a crucial difference.
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
"mailingList.asp"
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_ rhelms.asp " -->
<%
var rsMailingList = Server.CreateObject("ADODB .Recordset ");
rsMailingList.ActiveConnec tion = MM_conn_rhelms_STRING;
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati on = 2;
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai l/CDONTS_N ewMail_JS. asp" -->
<!--#include file="../WA_Universal_Emai l/MailForm atting_JS. asp" -->
<%
function WA_Universal_Email_1_SendM ail(Recipi entEmail) {
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o rg";
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO bject,Reci pientEmail );
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject," rhelmsmini stries@com cast.net") ;
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj ect,0);
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail Object,"3" );
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "<title>Untitled Document</title>\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\ " content=\"text/html; charset=iso-8859-1\">\r\n" ;
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + (""+Request.Form("bodyMess age").Valu e).replace ("\n", "<br>");
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>\r\n";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec t,MailAtta chments,Ma ilBCC,Mail CC,MailTo, MailImport ance,MailF rom,MailSu bject,Mail Body);
WA_MailObject = null;
}
%>
<%
if ((String(Request.Form("Sub mit")) != "undefined")) {
//WA Universal Email object="CDONTS NewMail"
//Send Loop Once Per Entry
WA_Universal_Email_1_SendM ail("rsMai lingList.r egEmail");
//Send Mail All Entries
if ("mailing_success.asp"!="" ) {
Response.Redirect("mailing _success.a sp");
}
}
%>
<html>
<head>
<title>RHELMSMINISTRIES</t itle>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles/Event_Styl es.css" rel="stylesheet" type="text/css">
<link href="styles/navStyles.css " rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC">
<div align="center">
<!-- Fireworks MX Dreamweaver MX target. Created Fri Dec 02 18:52:31 GMT-0500 (Eastern Standard Time) 2005-->
<script language="JavaScript">
<!--
/* Functions that swaps images. */
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre loadImages .arguments ; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<table width="722" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td width="1"><img src="../images/1px_trans.g if" width="1" height="1"></td>
<td width="720"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="498" bgcolor="#CCCC99"><img src="../images/RHM%20Logo. jpg" width="244" height="100"></td>
<td width="222" bgcolor="b32318"> </t d>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="b32318">
<td bgcolor="b32318"><!--#incl ude file="r_admin_nav.asp" --></td>
</tr>
<tr>
<td valign="top"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" background="../images/bkg1 .gif"><tab le width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="cccc99" bgcolor="e7e7cf">
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top"><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare a>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="b32318"> </t d>
</tr>
</table>
</td>
</tr>
</table></td>
<td width="1"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td colspan="3"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
</table>
</div>
</body>
</html>
<%
rsMailingList.Close();
%>
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
"mailingList2_TEST.asp"
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connH elms.asp" -->
<%
Dim rsMailingList
Dim rsMailingList_numRows
Set rsMailingList = Server.CreateObject("ADODB .Recordset ")
rsMailingList.ActiveConnec tion = MM_connHelms_STRING
rsMailingList.Source = "SELECT * FROM test_reg"
rsMailingList.CursorType = 0
rsMailingList.CursorLocati on = 2
rsMailingList.LockType = 1
rsMailingList.Open()
rsMailingList_numRows = 0
%>
<!--#include file="../WA_Universal_Emai l/CDONTS_N ewMail_VB. asp" -->
<!--#include file="../WA_Universal_Emai l/MailForm atting_VB. asp" -->
<%
function WA_Universal_Email_1_SendM ail(Recipi entEmail)
dim MailObject, MailAttachments, MailBCC, MailCC, MailTo, MailBodyFormat, MailBody, MailImportance, MailFrom, MailSubject
MailAttachments = ""
MailBCC = ""
MailCC = ""
MailTo = ""
MailBodyFormat = ""
MailBody = ""
MailImportance = ""
MailFrom = "mailinglist@randalhelms.o rg"
MailSubject = "Test Mailing List"
'Global Variables
gAddBCC = ""
gAddCC = ""
gAddRecipient = ""
gBodyFormat = ""
gSetImportance = ""
set WA_MailObject = WAUE_Definition()
if (RecipientEmail <> "") then
set WA_MailObject = WAUE_AddRecipient(WA_MailO bject,Reci pientEmail )
MailTo = gAddRecipient
gAddRecipient = ""
else
'To Entries
end if
'Attachment Entries
'BCC Entries
MailBCC = gAddBCC
'CC Entries
MailCC = gAddCC
'Body Format
set WA_MailObject = WAUE_BodyFormat(WA_MailObj ect,0)
MailBodyFormat = gBodyFormat
'Set Importance
set WA_MailObject = WAUE_SetImportance(WA_Mail Object,"3" )
MailImportance = gSetImportance
'Start Mail Body
MailBody = MailBody & "<html>" & vbCrlf & ""
MailBody = MailBody & "<head>" & vbCrlf & ""
MailBody = MailBody & "<title>Untitled Document</title>" & vbCrlf & ""
MailBody = MailBody & "<meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=iso-8859-1" & Chr(34) & ">" & vbCrlf & ""
MailBody = MailBody & "</head>" & vbCrlf & ""
MailBody = MailBody & "" & vbCrlf & ""
MailBody = MailBody & "<body>" & vbCrlf & ""
MailBody = MailBody & "<img src=" & Chr(34) & "http://www.randalhelms.org/images/RHM%20Logo.jpg" & Chr(34) & " width=" & Chr(34) & "244" & Chr(34) & " height=" & Chr(34) & "100" & Chr(34) & ">" & vbCrlf & ""
MailBody = MailBody & "<br>" & vbCrlf & ""
MailBody = MailBody & "<br>" & vbCrlf & ""
MailBody = MailBody & replace(request("bodyMessa ge"), vbcrlf,"<br>")
MailBody = MailBody & "" & vbCrlf & ""
MailBody = MailBody & "</body>" & vbCrlf & ""
MailBody = MailBody & "</html>" & vbCrlf & ""
MailBody = MailBody & "" & vbCrlf & ""
'End Mail Body
set WA_MailObject = WAUE_SendMail(WA_MailObjec t,MailAtta chments,Ma ilBCC,Mail CC,MailTo, MailImport ance,MailF rom,MailSu bject,Mail Body)
set WA_MailObject = nothing
end function
%>
<%
if ((cStr(Request.Form("Submi t")) <> "")) then
'WA Universal Email object="CDONTS NewMail"
'Send Loop Once Per Entry
while (NOT rsMailingList.EOF)
WA_Universal_Email_1_SendM ail("" & cStr(rsMailingList.Fields. Item("regE mail").Val ue) & "")
rsMailingList.MoveNext()
wend
if (rsMailingList.CursorType > 0) then
rsMailingList.MoveFirst
else
rsMailingList.Requery
end if
'Send Mail All Entries
if ("mailing_success.asp"<>"" ) then
Response.Redirect("mailing _success.a sp")
end if
end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="450" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare a></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail"></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
<%
rsMailingList.Close()
Set rsMailingList = Nothing
%>
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---
Thank you.
I know the "mailinList.asp" is "JAVASCRIPT" and the "mailingList2_TEST.asp" is "VBSCRIPT". Perhaps you could still identify a crucial difference.
--------------------------
"mailingList.asp"
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_
<%
var rsMailingList = Server.CreateObject("ADODB
rsMailingList.ActiveConnec
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai
<!--#include file="../WA_Universal_Emai
<%
function WA_Universal_Email_1_SendM
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject,"
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "<title>Untitled Document</title>\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + (""+Request.Form("bodyMess
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>\r\n";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec
WA_MailObject = null;
}
%>
<%
if ((String(Request.Form("Sub
//WA Universal Email object="CDONTS NewMail"
//Send Loop Once Per Entry
WA_Universal_Email_1_SendM
//Send Mail All Entries
if ("mailing_success.asp"!=""
Response.Redirect("mailing
}
}
%>
<html>
<head>
<title>RHELMSMINISTRIES</t
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles/Event_Styl
<link href="styles/navStyles.css
</head>
<body bgcolor="#CCCCCC">
<div align="center">
<!-- Fireworks MX Dreamweaver MX target. Created Fri Dec 02 18:52:31 GMT-0500 (Eastern Standard Time) 2005-->
<script language="JavaScript">
<!--
/* Functions that swaps images. */
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<table width="722" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="../images/1px_trans.g
</tr>
<tr>
<td width="1"><img src="../images/1px_trans.g
<td width="720"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="498" bgcolor="#CCCC99"><img src="../images/RHM%20Logo.
<td width="222" bgcolor="b32318"> </t
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="b32318">
<td bgcolor="b32318"><!--#incl
</tr>
<tr>
<td valign="top"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" background="../images/bkg1
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="cccc99" bgcolor="e7e7cf">
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top"><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="../images/1px_trans.g
</tr>
<tr>
<td bgcolor="b32318"> </t
</tr>
</table>
</td>
</tr>
</table></td>
<td width="1"><img src="../images/1px_trans.g
</tr>
<tr>
<td colspan="3"><img src="../images/1px_trans.g
</tr>
</table>
</div>
</body>
</html>
<%
rsMailingList.Close();
%>
--------------------------
--------------------------
"mailingList2_TEST.asp"
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connH
<%
Dim rsMailingList
Dim rsMailingList_numRows
Set rsMailingList = Server.CreateObject("ADODB
rsMailingList.ActiveConnec
rsMailingList.Source = "SELECT * FROM test_reg"
rsMailingList.CursorType = 0
rsMailingList.CursorLocati
rsMailingList.LockType = 1
rsMailingList.Open()
rsMailingList_numRows = 0
%>
<!--#include file="../WA_Universal_Emai
<!--#include file="../WA_Universal_Emai
<%
function WA_Universal_Email_1_SendM
dim MailObject, MailAttachments, MailBCC, MailCC, MailTo, MailBodyFormat, MailBody, MailImportance, MailFrom, MailSubject
MailAttachments = ""
MailBCC = ""
MailCC = ""
MailTo = ""
MailBodyFormat = ""
MailBody = ""
MailImportance = ""
MailFrom = "mailinglist@randalhelms.o
MailSubject = "Test Mailing List"
'Global Variables
gAddBCC = ""
gAddCC = ""
gAddRecipient = ""
gBodyFormat = ""
gSetImportance = ""
set WA_MailObject = WAUE_Definition()
if (RecipientEmail <> "") then
set WA_MailObject = WAUE_AddRecipient(WA_MailO
MailTo = gAddRecipient
gAddRecipient = ""
else
'To Entries
end if
'Attachment Entries
'BCC Entries
MailBCC = gAddBCC
'CC Entries
MailCC = gAddCC
'Body Format
set WA_MailObject = WAUE_BodyFormat(WA_MailObj
MailBodyFormat = gBodyFormat
'Set Importance
set WA_MailObject = WAUE_SetImportance(WA_Mail
MailImportance = gSetImportance
'Start Mail Body
MailBody = MailBody & "<html>" & vbCrlf & ""
MailBody = MailBody & "<head>" & vbCrlf & ""
MailBody = MailBody & "<title>Untitled Document</title>" & vbCrlf & ""
MailBody = MailBody & "<meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=iso-8859-1" & Chr(34) & ">" & vbCrlf & ""
MailBody = MailBody & "</head>" & vbCrlf & ""
MailBody = MailBody & "" & vbCrlf & ""
MailBody = MailBody & "<body>" & vbCrlf & ""
MailBody = MailBody & "<img src=" & Chr(34) & "http://www.randalhelms.org/images/RHM%20Logo.jpg" & Chr(34) & " width=" & Chr(34) & "244" & Chr(34) & " height=" & Chr(34) & "100" & Chr(34) & ">" & vbCrlf & ""
MailBody = MailBody & "<br>" & vbCrlf & ""
MailBody = MailBody & "<br>" & vbCrlf & ""
MailBody = MailBody & replace(request("bodyMessa
MailBody = MailBody & "" & vbCrlf & ""
MailBody = MailBody & "</body>" & vbCrlf & ""
MailBody = MailBody & "</html>" & vbCrlf & ""
MailBody = MailBody & "" & vbCrlf & ""
'End Mail Body
set WA_MailObject = WAUE_SendMail(WA_MailObjec
set WA_MailObject = nothing
end function
%>
<%
if ((cStr(Request.Form("Submi
'WA Universal Email object="CDONTS NewMail"
'Send Loop Once Per Entry
while (NOT rsMailingList.EOF)
WA_Universal_Email_1_SendM
rsMailingList.MoveNext()
wend
if (rsMailingList.CursorType > 0) then
rsMailingList.MoveFirst
else
rsMailingList.Requery
end if
'Send Mail All Entries
if ("mailing_success.asp"<>""
Response.Redirect("mailing
end if
end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="450" border="1" cellspacing="0" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail"></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
<%
rsMailingList.Close()
Set rsMailingList = Nothing
%>
--------------------------
Thank you.
ASKER
Hi. Actually, I discovered my problem with appearing at the INBOX. I did not have the "TO:" assigned to my recordset.
The image coded in the "BODY:" area is coming through just fine at the E-mail INBOX. However, the text I type in the MEMO field to send to recipients is appearing under the image at the E-mail INBOX as "Undefined". It seems this may be a very small detail I am overlooking, but I can not seem to locate it.
Your help is most appreciated. My code for ONLY THIS page is below:
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ------
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_ rhelms.asp " -->
<%
var rsMailingList = Server.CreateObject("ADODB .Recordset ");
rsMailingList.ActiveConnec tion = MM_conn_rhelms_STRING;
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati on = 2;
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai l/CDONTS_N ewMail_JS. asp" -->
<!--#include file="../WA_Universal_Emai l/MailForm atting_JS. asp" -->
<%
function WA_Universal_Email_1_SendM ail(Recipi entEmail) {
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o rg";
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO bject,Reci pientEmail );
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject," rhelmsmini stries@com cast.net") ;
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj ect,0);
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail Object,"3" );
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\ " content=\"text/html; charset=iso-8859-1\">\r\n" ;
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + (""+Request.Form("bodyMess age").Valu e).replace ("\n", "<br>");
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec t,MailAtta chments,Ma ilBCC,Mail CC,MailTo, MailImport ance,MailF rom,MailSu bject,Mail Body);
WA_MailObject = null;
}
%>
<%
if ((String(Request.Form("Sub mit")) != "undefined")) {
//WA Universal Email object="CDONTS NewMail"
//Send Loop Once Per Entry
WA_Universal_Email_1_SendM ail("" + String((rsMailingList.Fiel ds.Item("r egEmail"). Value)) + "");
//Send Mail All Entries
if ("mailing_success.asp"!="" ) {
Response.Redirect("mailing _success.a sp");
}
}
%>
<html>
<head>
<title>RHELMSMINISTRIES</t itle>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles/Event_Styl es.css" rel="stylesheet" type="text/css">
<link href="styles/navStyles.css " rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC">
<div align="center">
<!-- Fireworks MX Dreamweaver MX target. Created Fri Dec 02 18:52:31 GMT-0500 (Eastern Standard Time) 2005-->
<script language="JavaScript">
<!--
/* Functions that swaps images. */
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre loadImages .arguments ; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<table width="722" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td width="1"><img src="../images/1px_trans.g if" width="1" height="1"></td>
<td width="720"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="498" bgcolor="#CCCC99"><img src="../images/RHM%20Logo. jpg" width="244" height="100"></td>
<td width="222" bgcolor="b32318"> </t d>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="b32318">
<td bgcolor="b32318"><!--#incl ude file="r_admin_nav.asp" --></td>
</tr>
<tr>
<td valign="top"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" background="../images/bkg1 .gif"><tab le width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="cccc99" bgcolor="e7e7cf">
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top"><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare a>
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="b32318"> </t d>
</tr>
</table>
</td>
</tr>
</table></td>
<td width="1"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
<tr>
<td colspan="3"><img src="../images/1px_trans.g if" width="1" height="1"></td>
</tr>
</table>
</div>
</body>
</html>
<%
rsMailingList.Close();
%>
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ------
Thank you,
lshane
The image coded in the "BODY:" area is coming through just fine at the E-mail INBOX. However, the text I type in the MEMO field to send to recipients is appearing under the image at the E-mail INBOX as "Undefined". It seems this may be a very small detail I am overlooking, but I can not seem to locate it.
Your help is most appreciated. My code for ONLY THIS page is below:
--------------------------
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="../Connections/conn_
<%
var rsMailingList = Server.CreateObject("ADODB
rsMailingList.ActiveConnec
rsMailingList.Source = "SELECT * FROM test_reg";
rsMailingList.CursorType = 0;
rsMailingList.CursorLocati
rsMailingList.LockType = 1;
rsMailingList.Open();
var rsMailingList_numRows = 0;
%>
<!--#include file="../WA_Universal_Emai
<!--#include file="../WA_Universal_Emai
<%
function WA_Universal_Email_1_SendM
var MailAttachments = "";
var MailBCC = "";
var MailCC = "";
var MailTo = "";
var MailBodyFormat = "";
var MailBody = "";
var MailImportance = "";
var MailFrom = "mailinglist@randalhelms.o
var MailSubject = "RHELMSMINISTRIES";
//Global Variables
gAddBCC = "";
gAddCC = "";
gAddRecipient = "";
gBodyFormat = "";
gSetImportance = "";
WA_MailObject = WAUE_Definition();
if (RecipientEmail) {
WA_MailObject = WAUE_AddRecipient(WA_MailO
MailTo = gAddRecipient;
gAddRecipient = "";
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
MailBCC = gAddBCC;
//CC Entries
WA_MailObject = WAUE_AddCC(WA_MailObject,"
MailCC = gAddCC;
//Body Format
WA_MailObject = WAUE_BodyFormat(WA_MailObj
MailBodyFormat = gBodyFormat;
//Set Importance
WA_MailObject = WAUE_SetImportance(WA_Mail
MailImportance = gSetImportance;
//Start Mail Body
MailBody = MailBody + "<html>\r\n";
MailBody = MailBody + "<head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<meta http-equiv=\"Content-Type\
MailBody = MailBody + "</head>\r\n";
MailBody = MailBody + "\r\n";
MailBody = MailBody + "<body>\r\n";
MailBody = MailBody + "<img src=\"http://www.randalhelms.org/images/RHM%20Logo.jpg\" width=\"244\" height=\"100\">\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + "<br>\r\n";
MailBody = MailBody + (""+Request.Form("bodyMess
MailBody = MailBody + "\r\n";
MailBody = MailBody + "</body>\r\n";
MailBody = MailBody + "</html>";
//End Mail Body
WA_MailObject = WAUE_SendMail(WA_MailObjec
WA_MailObject = null;
}
%>
<%
if ((String(Request.Form("Sub
//WA Universal Email object="CDONTS NewMail"
//Send Loop Once Per Entry
WA_Universal_Email_1_SendM
//Send Mail All Entries
if ("mailing_success.asp"!=""
Response.Redirect("mailing
}
}
%>
<html>
<head>
<title>RHELMSMINISTRIES</t
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../styles/Event_Styl
<link href="styles/navStyles.css
</head>
<body bgcolor="#CCCCCC">
<div align="center">
<!-- Fireworks MX Dreamweaver MX target. Created Fri Dec 02 18:52:31 GMT-0500 (Eastern Standard Time) 2005-->
<script language="JavaScript">
<!--
/* Functions that swaps images. */
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_pre
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<table width="722" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td colspan="3"><img src="../images/1px_trans.g
</tr>
<tr>
<td width="1"><img src="../images/1px_trans.g
<td width="720"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="720" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="498" bgcolor="#CCCC99"><img src="../images/RHM%20Logo.
<td width="222" bgcolor="b32318"> </t
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="b32318">
<td bgcolor="b32318"><!--#incl
</tr>
<tr>
<td valign="top"><table width="720" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" background="../images/bkg1
<tr>
<td> </td>
</tr>
<tr>
<td valign="top"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="cccc99" bgcolor="e7e7cf">
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top"><form name="form1" method="post" action="">
<table width="500" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="100" valign="top">Message:</td>
<td width="350"><textarea name="bodyMessage" cols="60" rows="30" id="bodyMessage"></textare
</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="send mail">
</td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center" valign="top"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="../images/1px_trans.g
</tr>
<tr>
<td bgcolor="b32318"> </t
</tr>
</table>
</td>
</tr>
</table></td>
<td width="1"><img src="../images/1px_trans.g
</tr>
<tr>
<td colspan="3"><img src="../images/1px_trans.g
</tr>
</table>
</div>
</body>
</html>
<%
rsMailingList.Close();
%>
--------------------------
Thank you,
lshane
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.