...

View Full Version : cdosys problems



superchris9
08-11-2004, 03:36 AM
i don't know what the prob is with this



<%@LANGUAGE="VBSCRIPT"%>
<%
If request.servervariables("CONTENT_LENGTH") <> 0 THEN
Set objEMail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
Confi.Update
Set objEMail.Configuration = objConfig
objEMail.To = "someone@mail.com" 'i have inputed a valid address while testing here
objEMail.From = Request("from")
objEMail.Subject = Request("subject")
objEMail.TextBody = Request("message")
objEMail.Send
Set objEMail = Nothing

Response.Write("Message Sent")
Else

%>
<html>
<body>
<form method="post" action="stupid.asp">
From Email: <INPUT type=text name="from"><br />
Subject: <INPUT type=text name="subject"><br />
Message: <TEXTAREA name="message" rows=10 cols=40></TEXTAREA><br />
<INPUT type="submit" value="Send" name="submit">
</form>
</body>
</html>
<%
End If
%>



the mail never gets delivered. this is copied straight from a tutorial

miranda
08-12-2004, 10:49 PM
try this instead



<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Library" -->
<%
on error resume next
If Len(Request.Form("submit")) <> 0 THEN
Set objEMail = Server.CreateObject("CDO.Message")
objEMail.To = "someone@mail.com" 'input a valid address here
objEMail.From = Request.Form("from")
objEMail.Subject = Request.Form("subject")
objEMail.TextBody = Request.Form("message")
objEMail.Send()
Set objEMail = Nothing

If err.number = 0 Then ' only display message sent if there is no error
Response.Write("Message Sent")
End If
Else

%>
<html>
<body>
<form method="post" action="stupid.asp">
From Email: <INPUT type=text name="from"><br />
Subject: <INPUT type=text name="subject"><br />
Message: <TEXTAREA name="message" rows=10 cols=40></TEXTAREA><br />
<INPUT type="submit" value="Send" name="submit">
</form>
</body>
</html>
<%
End If
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum