Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS : HTML code scrambled

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

I wrote the following ASP code to process a form submission and send an email with the submitted data :

'Define mail object
Dim objMail
'Create mail object
Set objMail = Server.CreateObject ("CDONTS.NewMail")
'Set a Reply-To-address
objMail.From = "MyAddress@Home.com"
'Mail Subject
objMail.Subject = "New Database Entry"
'Send mail to supervisor
objMail.To = CRFMailAddress
'Send a copy to the user who submits the data
objMail.CC = User
'Body message type : HTML
objMail.BodyFormat = 0
'Mail type : MIME
objMail.MailFormat = 0
'Body message text

objMail.Body = (&quot;A new entry has been made on &quot; + FormatDateTime(Now) + &quot;. The user who submitted it is <A HREF=&quot;&quot;mailto:&quot; + User + &quot;&quot;&quot;>&quot; + UserName + &quot;</A>.<P><U>Details : </U></P><P><TABLE width=&quot;&quot;50%&quot;&quot; border=&quot;&quot;4&quot;&quot; bordercolor=&quot;&quot;#BBD9F7&quot;&quot; bordercolordark=&quot;&quot;#08297b&quot;&quot;><TR><TD><B>Configuration ID</B></TD><TD>&quot; + request.Form (&quot;Config&quot;) + &quot;</TD></TR><TR><TD><B>User Name</B></TD><TD>&quot; + request.Form (&quot;SUserLast&quot;) + &quot;</TD></TR><TR><TD><B>User First Name</B></TD><TD>&quot; + request.Form (&quot;SUserFirst&quot;) + &quot;</TD></TR><TR><TD><B>User ID</B></TD><TD>&quot; + request.Form (&quot;SUserID&quot;) + &quot;</TD></TR></TABLE></P><P>Please consult the attachments for further details.&quot;)

'Attachment processing
Dim FString, FArray, FName
'Retrieve file list
FString = Request.Form(&quot;Files&quot;)
'Get file names from file string
FArray = Split (FString, &quot;;&quot;)
for i=0 to (UBound(FArray)-1)
if FArray(i) <> &quot;&quot; then
'Define file to be sent
FArray(i) = FolderName + FArray(i)
'Give user-friendly name to file attachment
FName = right (FArray(i), (len(FArray(i)) - instr (FArray(i), &quot; CRF_&quot;) + 1))
'Add attachment
objMail.AttachFile FArray(i), FName
end if
next

'Send mail
objMail.Send
Set objMail = nothing

All users that use this asp form receive an HTML email with the table, clickable username and attachments, except for one... This person gets the following text :

&quot;... submitted it is John Doe <mailto:john.doe@home.com>&quot;

and no attachments are included. So this looks like the code is cut off in the middle of the body text. CDONTS does send mail from the server, so I don't understand why a certain client configuration could give problems with this script, but still it's very annoying. Does someone have a clue what I could check on the client to solve this?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top