I found a solution... don't use CDONTS.

Apparently, CDONTS has joined the fate of my beloved DAO, but to the point
that it doesn't always work that well as legacy software.

Enter CDO, stage right:

Dim objMessage
Set objMessage = Server.CreateObject("CDO.Message")
objMessage.To = "[EMAIL PROTECTED]"
objMessage.From = "[EMAIL PROTECTED]"
objMessage.Subject = "Why I'm sending this email"
objMessage.TextBody = "What I want you to know"
objMessage.AddAttachment "C:\MyFolder\MyFile.something"
objMessage.Send
Set objMessage = Nothing

Far




-----Original Message-----
From: The Professional Network [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 17, 2004 3:34 PM
To: ASP Developers
Subject: [ASP] CDONTS out-of-body experience


I have an extraordinarily plain CDONTS routine that is acting weird.

The code is:

     dim obj_Email
     set obj_Email = Server.CreateObject("CDONTS.Newmail")

     obj_Email.To           = Session("ses_strEmailAddressFromUser")
     obj_Email.Cc           = ""
     obj_Email.From         = "[EMAIL PROTECTED]"
     obj_Email.Bcc          = ""
     obj_Email.AttachFile   Application("app_strApplicationPath") & _
                            "\Print\Request_" & _
                            Session("ses_intRequestNumber") & _
                            ".htm"

     obj_Email.Subject      = "The Resume File You Requested"

     obj_Email.Body         = "Thank you for your request." & _
                              vbcrlf & vbcrlf & _
                              "The resume file you requested at " & _
                              "The Access Wizard is included " & _
                              "as an attachment." & _
                              vbcrlf & vbcrlf & _
                              "You can double-click on the attachment, " & _
                              "and then click your browser's PRINT tool " &
_
                              "to print it." & _
                              vbcrlf & vbcrlf & _
                              "We look forward to your next visit at " & _
                              "www.TheAccessWizard.com"

     obj_Email.Send

     Set obj_Email = Nothing

If I DO NOT include the attachment, when the email arrives, the body of the
message consists of the content of obj_Email.Body, which makes sense.

But if I DO include the attachment line, obj_Email.AttachFile ..., the
content
of obj_Email.Body arrives as an attachment, and the content of the
attachment (which is HTML) arrives as the body of the message.

Does anyone know how to make the body stay in the body, and the attachment
stay as an attachment?

TIA,

Far Farley
The Professional Network



[Non-text portions of this message have been removed]







---------------------------------------------------------------------
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links











------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to