|
 |
asp_web_howto thread: CDO - CDONTS - FileSystemObject
Message #1 by Scott Watermasysk <swatermasysk@C...> on Tue, 20 Feb 2001 13:35:39 -0500
|
|
Hello All,
I sent this message the ASP_CDO board earlier, butt I haven't gotten any
response. I hoping someone here can offer some advice.
-Scott
What are the advantages of using CDONTS (or a thrid party tool) over simply
creating a text file with the filesystemobject?
This site will not generate very many messages, but another one I am working
on will.
Here is a sample of what I am talking about. My site has a custom 404 error
page. All it really does is just gives the user a way to navigate back to
the site. In addition, it sends me an automated email stating where the
error occured and when.
ASP Script:
<%
'Send an Error Message to the Webmaster Account
Dim sSendInfo, fs, sBody, msg
'Send to who
sSendInfo = "x-sender: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "x-receiver:
webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "From: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "To: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "Subject: CHSInternational Auto Error
Message"
'Body of message: Details
sBody = sBody & vbcrlf & "Date of Error: " & Date()
sBody = sBody & vbcrlf & "Requested URL: " & Request.QueryString
sBody = sBody & vbcrlf & "IP Address: " &
Request.ServerVariables("REMOTE_ADDR")
sBody = sBody & vbcrlf & "Domaine Name: " &
Request.ServerVariables("REMOTE_HOST")
Set fs = CreateObject("Scripting.FileSystemObject")
Set msg = fs.CreateTextFile("C:\InetPub\mailroot\pickup\message.txt", True)
msg.WriteLine sSendInfo
msg.WriteBlankLines(1)
msg.WriteLine sBody
msg.Close
Set fs = Nothing
Set msg = Nothing
%>
On another site I have I use ASPMail. I haven't had any problems but the
site at them moment does not generate much usage.
I guess what I am trying to say is, what is the best way to send SMTP mail
via ASP? (CDONTS, FileSystemObject, or 3rd Party).
Thanks,
Scott
Message #2 by "BACHORIK, Martin" <BACHORIKM@a...> on Wed, 21 Feb 2001 08:04:07 +0100
|
|
That's my preffered way (and it's working OK):
<%
Sub Send_Message(strFrom, strTo, strSubject, strBody, strCc)
Set objMsg = Server.CreateObject("CDONTS.NewMail")
With objMsg
.To = strTo
.From = strFrom
.Cc = strCc
.Bcc = strBcc
.Subject = strSubject
.Body = strBody
.Send
End With
Set objMsg = nothing
End Sub
%>
Martin
-----Original Message-----
From: Scott Watermasysk [mailto:swatermasysk@C...]
Sent: 20. február 2001 19:36
To: ASP Web HowTo
Subject: [asp_web_howto] CDO - CDONTS - FileSystemObject
Hello All,
I sent this message the ASP_CDO board earlier, butt I haven't gotten any
response. I hoping someone here can offer some advice.
-Scott
What are the advantages of using CDONTS (or a thrid party tool) over simply
creating a text file with the filesystemobject?
This site will not generate very many messages, but another one I am working
on will.
Here is a sample of what I am talking about. My site has a custom 404 error
page. All it really does is just gives the user a way to navigate back to
the site. In addition, it sends me an automated email stating where the
error occured and when.
ASP Script:
<%
'Send an Error Message to the Webmaster Account
Dim sSendInfo, fs, sBody, msg
'Send to who
sSendInfo = "x-sender: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "x-receiver:
webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "From: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "To: webmaster@c..."
sSendInfo = sSendInfo & vbcrlf & "Subject: CHSInternational Auto Error
Message"
'Body of message: Details
sBody = sBody & vbcrlf & "Date of Error: " & Date()
sBody = sBody & vbcrlf & "Requested URL: " & Request.QueryString
sBody = sBody & vbcrlf & "IP Address: " &
Request.ServerVariables("REMOTE_ADDR")
sBody = sBody & vbcrlf & "Domaine Name: " &
Request.ServerVariables("REMOTE_HOST")
Set fs = CreateObject("Scripting.FileSystemObject")
Set msg = fs.CreateTextFile("C:\InetPub\mailroot\pickup\message.txt", True)
msg.WriteLine sSendInfo
msg.WriteBlankLines(1)
msg.WriteLine sBody
msg.Close
Set fs = Nothing
Set msg = Nothing
%>
On another site I have I use ASPMail. I haven't had any problems but the
site at them moment does not generate much usage.
I guess what I am trying to say is, what is the best way to send SMTP mail
via ASP? (CDONTS, FileSystemObject, or 3rd Party).
Thanks,
Scott
$subst('Email.Unsub')
|
|
 |