Click here to Skip to main content
6,630,586 members and growing! (17,597 online)
Email Password   helpLost your password?
Web Development » ASP » General     Intermediate

Attaching Files with CDO Mail

By rampdci

CDO Mail Description
Windows, ASP, Visual Studio, Dev
Posted:22 Jun 2004
Views:45,915
Bookmarked:15 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
6 votes for this article.
Popularity: 1.02 Rating: 1.31 out of 5
5 votes, 83.3%
1

2

3

4
1 vote, 16.7%
5

Introduction

Hello guys here is the code for who search for CDO mailing attachment.

In this case I have used the file attachment based on the no of selected items in Request Page.If the relevant check is done for file download then related files will be added in 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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtpserver"
Flds.update


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)
objMessage.AddAttachment(Server.MapPath(download))

Next

objMessage.fields.update
objMessage.Send


set objMessage = nothing
set objConfig = nothing
Hope you guys can program with it.

Happy Programming!!!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

rampdci


Member

Location: India India

Other popular ASP articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralHow do you attach files that the user submits through a form? Pinmemberdeprivedwriter7:19 26 Sep '08  
GeneralAttaching a PDF On-the-fly PinmemberTWZDegen11:35 31 Oct '06  
GeneralRe: Attaching a PDF On-the-fly PinmemberRothariger10:58 7 Feb '07  
QuestionAn error occurs evrytime Pinmemberlive n let live1:03 28 Apr '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 22 Jun 2004
Editor:
Copyright 2004 by rampdci
Everything else Copyright © CodeProject, 1999-2009
Web10 | Advertise on the Code Project