Hi again. I've been messing around here and think i'm getting somewhere. Unfortunately I can't access the actual server that I'll be using at present (I will tomorrow at work) and I can't seem to get my localhost to process CDOSYS (browser gives the following error :Error Type:CDO.Message.1 (0x80070005). Access is denied. /ecard/html4.asp, line 25). This means that I can't really test out what i'm doing.
Can someone tell me if I'm on the right track with this code:
<!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">
<body>
<%
dim MyMail, strHtmlBody
SMTPServer = "localhost"
cdoURL = "http://schemas.microsoft.com/cdo/configuration/"
Set MyMail = CreateObject("CDO.Message")
Set cdoC = CreateObject("CDO.Configuration")
Set cdoF = cdoC.Fields
With cdoF
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With
strHtmlBody = strHtmlBody & "<HTML>"
strHtmlBody = strHtmlBody & "<p align="center"> Hello <% response.write(request.form("rName"))%>, <% response.write(request.form("sName"))%> has sent you this ecard:"
strHtmlBody = strHtmlBody & "<img src=""http://www.mysite.com/images/ecard1.jpg""></p>"
strHtmlBody = strHtmlBody & "<b>Message:</b><% response.write(request.form("body"))%>"
strHtmlBody = strHtmlBody & "<p><a href=""http://www.mysite.com/ecard.asp"">click here</a> to send your own ecard."
strHtmlBody = strHtmlBody & "<p>Thank you</p>"
With MyMail
Set .Configuration = cdoC
.From = Request("sAddress")
.To = Request("rAddress")
.Subject = "Test"
.HTMLBody = strHtmlBody
.Send
End With
Set MyMail = Nothing
Set cdoS = Nothing
Set cdoF = Nothing
%>
Your ecard has been sent. Thank you!
</body>
</html>
Much appreciated.
-eogmp3
Last edited by eogmp3 : Oct 22nd, 2006 at 1:45 pm.