Click here to Skip to main content
11,496,146 members (649 online)
Click here to Skip to main content

Attaching files with a CDO mail

, 22 Jun 2004 CPOL 60.5K 17
Code for who search for CDO mailing attachments.
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.


Hello guys, here is the code for who search for a CDO mailing attachment. In this case, I have used the file attachment based on the number of selected items in the Request page. If the relevant check is done for the file download, then the related files will be added in the attachment and sent as mail.

'++++++++++= CDO Mail ++++++++++++++++

set objMessage = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")

' Setting the SMTP Server
Set Flds = objConfig.Fields
Flds.Item("") = 2
Flds.Item("") = 

Set objMessage.Configuration = objConfig
objMessage.To = strRecipientString
objMessage.From = strFromString
objMessage.Subject = strSubject
objMessage.TextBody = strMessageBody

'--------- Attach the files -----------

For i=1 to counter
FreeTools = Request.Form("dowloadfile")(i)



set objMessage = nothing
set objConfig = nothing

Hope you guys can program with it.

Happy programming!!!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author


India India
No Biography provided

Comments and Discussions

QuestionAn error occurs evrytime Pin
live n let live28-Apr-06 1:03
memberlive n let live28-Apr-06 1:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 23 Jun 2004
Article Copyright 2004 by rampdci
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid