troubleshooting Question

different email results from the same code - one recipient only gets a "0" in the email

Avatar of IIS6_cursed
IIS6_cursed asked on
ASP
6 Comments1 Solution296 ViewsLast Modified:
This one is a real challenge.  The code is listed below.  

The problem:  When someone submits a request using this form, two emails are generated.  One to my work email account, and the other to a general mailbox for the department that fills the request.  The email I receive looks fine and works without problem, but the email the department gets simply has a "0" in it.  That's all -  no information, no data, just a 0.  I'm using the same process to generate both emails, so this doesn't make any sense.

Any ideas?  Is this a coding issue or is something wrong with the other mailbox?  This form worked fine for them when we were on an IIS5 server - but since we migrated to IIS6, it doesn't want to work.  Please advise.  Thanks!

<%
' Setup E-mail and send to Network Management...
Set myMail = Server.CreateObject("CDO.Message")

myMail.From = objUpload.Form.Item(6)
myMail.To = "m6_nmanalysis@healthlink.com"
myMail.To = "bptouch@healthlink.com"

myMail.Subject = "GR-" & currentNetManGRNum & " / " & objUpload.Form.Item(2)

If objUpload.Files.Count > 0 Then
      For lngLoop = 0 to objUpload.Files.Count - 1
            myMail.AddAttachment Server.MapPath("../Data/" & objUpload.Files.Item(lngLoop).FileName)
      Next
End If

myMail.TextBody = 1
myMail.HtmlBody = 0

myBodyText = "-----------------------"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "REQUESTOR'S INFORMATION"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "-----------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Requested By:"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "   Name: " & objUpload.Form.Item(4) & " " &  objUpload.Form.Item(5)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "   E-Mail: " & objUpload.Form.Item(6)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "   Department: " & objUpload.Form.Item(8)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "   Phone Number: " & objUpload.Form.Item(7)
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "---------------------"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "DATE REQUESTED/NEEDED"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "---------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Date Requested: " & FormatDateTime(Date(),1)
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "Date Needed: " & objUpload.Form.Item(1)
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "----------------------------"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "ANALYST GENERAL REQUEST INFO"
myBodyText = myBodyText & vbCrLf
myBodyText = myBodyText & "----------------------------"
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Analyst General Request Form Number: GR-" & currentNetManGRNum
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Short Description: " & objUpload.Form.Item(2)
myBodyText = myBodyText & vbCrLf & vbCrLf
myBodyText = myBodyText & "Description: " & objUpload.Form.Item(3)
myBodyText = myBodyText & vbCrLf & vbCrLf

If objUpload.Files.Count > 0 Then
      myBodyText = myBodyText & "Attached File(s) or Document(s): The requester attached " & objUpload.Files.Count & " file(s) to this form."
Else
      myBodyText = myBodyText & "Attached File(s) or Document(s): The requester did not attach any files to this form."
End If

myMail.TextBody = myBodyText

myMail.Send

Set myMail = Nothing
%>

ASKER CERTIFIED SOLUTION
Carl Tawn
Senior Systems and Integration Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros