We have been using the same CDONTS asp script for a couple of years -
but some of our customers are complaining that they are not getting
the emails.
The way it works is that a user fills out a form, and then submits the
form (see code below) - and a copy of the email is sent to us. Some of
these just do not appear to be getting through despite others from the
same organisation working.
Any ideas? Code below, pretty long. There is a line which checks to
see if they have the rights for this email to be sent, and it isn't
that - I've tested this. The interesting thing is that I cannot
replcate these problems even when I log in as the users are who are
having these problems, which makes me wonder whether there are some
problems with CDONTS or IIS of which I am unaware that can cause these
intermittent problems?
Any help greatly appreciated.
Best wishes
Debbie
<snip>
'create the email to send to the mentor
set objsendmail = createobject("cdonts.newmail")
if len(Request.Form("EmailAddress")) <> 0 then
objsendmail.from = Request.Form("EmailAddress")
else
objsendmail.from = "onlineassignment@learnfish.com"
end if
if session("schemeid") = 1 or session("schemeid") = 3 or
session("schemeid") = 31 then
if cint(session("userid")) = 519 then
objsendmail.to = mentoremail
'response.write mentoremail
else
objsendmail.to = "assignments@learnfish.com"
'objsendmail.to = "alison@learnfish.com"
end if
else
objsendmail.to = mentoremail
end if
'if objRS2("companyid") = 441 then
'objsendmail.bcc = "alison@learnfish.com"
'end if
objsendmail.bcc = "assignmentrecords@learnfish.com"
objsendmail.subject = courseTitle & " " & "assignment from " &
objRS2("FirstName") & " " & objRS2("surname")
BodyText = BodyText & "UserID: " & objRS2("UserID") & vbcrlf
BodyText = BodyText & "MentorID: " & objRS2("MentorID") & vbcrlf
BodyText = BodyText & "Name: " & objRS2("FirstName") & " " &
objRS2("Surname") & vbcrlf
BodyText = BodyText & "Assignment: " & objRS3("ModuleName") & vbcrlf
BodyText = BodyText & "Email: " & Request.Form("EmailAddress")
dim count
count = 1
'general code for looping through form fields in order
'for x = 1 to request.form.count()
' response.write(request.form.key(x) & " = ")
' response.write(request.form.item(x) & "<br><br>")
'next
'new code for looping through questions in order
for x = 1 to request.form.count()
if left(request.form.key(x), 1) = "Q" then
BodyText = Bodytext & vbcrlf & request.form.key(x) & ": " &
request.form.item(x)
'response.write request.form.key(x) & " : " & request.form.item(x)
end if
'response.write BodyText
next
'old code for looping through questions (not in order)
'now write out the answers
'For Each Item in Request.QueryString
'if len(Request.QueryString("Q" & count)) Then
'BodyText = Bodytext & "Answer " & count & ": " &
Request.QueryString("Q" & count) & vbcrlf
'count = count + 1
'end if
'if left(Item, 1) = "Q" then
' BodyText = Bodytext & vbcrlf & "Answer " & Item & ": " &
Request.QueryString(Item)
'end if
'Next
'if the user is from an organisation which does not have full access
to the assignments then don't send the email
if custom(24) = 2 then
else
objsendmail.body = BodyText
objsendmail.send
set objsendmail = nothing
end if 'checking whether they have full access to assignments
<snip>