I’m using the below code to setup a webform that would sent comments to my email address. And below is the code
[CODE]
<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<%
theSchema=”http://schemas.microsoft.com/cdo/configuration/”
Set cdoConfig=Server.CreateObject(“CDO.Configuration”)
cdoConfig.Fields.Item(theSchema & “sendusing”)= 2
cdoConfig.Fields.Item(theSchema & “smtpserver”)=”smtp.gawab.com”
cdoConfig.Fields.Update
set cdoMessage=Server.CreateObject(“CDO.Message”)
cdoMessage.Configuration=cdoConfig
cdoMessage.From=Request.Form(“emailAddress”)
cdoMessage.To=”[email protected]”
cdoMessage.Subject= Request.Form(“subject”)
cdoMessage.TextBody= Request.Form(“body”)
cdoMessage.Send
Set cdoMessage=Nothing
Set cdoConfig=Nothing
%>
<head>
<title>Message sent</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<link href=”css/newland.css” rel=”stylesheet” type=”text/css” />
<script language=”JavaScript” type=”text/JavaScript”>
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==”Netscape”)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//–>
</script>
</head>
<body>
<div id=”accessibility” style=”position:absolute; left:213px; top:213px; width:332px; height:104px; z-index:1; visibility: hidden;”><a href=”#top”>Skip to main page content</a></div>
<table width=”750″ border=”0″ cellpadding=”3″ cellspacing=”0″>
<tr>
<td width=”1040″> </td>
<td width=”280″> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan=”2″>
<h1><br />
<a name=”top” id=”top”></a>Message Sent </h1>
<p> Your message has been sent. You should hear from us within two days </p>
</td>
</tr>
</table>
<br />
<br />
</body>
</html>
Where xxx was my user name. Btw i’m using dreamweaver but whenever i test the code, it doesn’t work. I’m using IIS as my localhost. It keep telling me that:
Technical Information (for support personnel)
Error Type:
CDO.Message.1 (0x8004020D)
At least one of the From or Sender fields is required, and neither was found.
/messageSent.asp, line 19
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Page:
GET /messageSent.asp
Can anyone please advice me on how to remedy this problem?Or direct me to other source of information?
Or if the above code is no good, can someone redirect me to other source where i can learn how to sent email through a form?
Thanks in advance
?