Print Page | Close Window

CDONTS Attachment trouble

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=4415
Printed Date: 02 April 2026 at 6:48am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: CDONTS Attachment trouble
Posted By: danww
Subject: CDONTS Attachment trouble
Date Posted: 21 July 2003 at 11:14am

Hi folks,

I'm using CDONTS to send an email with an image attachment.  The following code works okay except for when I un-remark the "'MyCDONTSMail.AttachFile sUploadImage" line (when I just get a message saying 'there is a problem with the page you are trying to view etc etc, no error code):


<%
dim sSubmit, sYourEmail, sFriendsEmail, sCat, sUploadImage
dim sBody, MyCDONTSMail

sCat  = request.form("cat")
sSubmit  = request.form("Submit")
sYourEmail  = request.form("YourName")
sFriendsEmail = request.form("FriendsEmail")
sUploadImage = Server.MapPath("/images/" & sCat & ".jpg")

if sSubmit = "Submit" then


    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From = sYourEmail
    MyCDONTSMail.To = sFriendsEmail
    MyCDONTSMail.Subject = "Subject of Email"   
    sBody = sYourEmail & " has sent the attached image to you, from etc..." & vbCrLf
    MyCDONTSMail.Body= sBody
    'MyCDONTSMail.AttachFile sUploadImage
    MyCDONTSMail.Send
    set MyCDONTSMail=nothing

else

do summat else
%>


Spot anything wrong with it???

Cheers very much for any help.

D




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net