logo
g Text Version
Auto
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Society & Culture
Sports
Travel & Leisure
TV & Movies

dailyclick
Bored? Games!
Postcards
Astrology
Take a Quiz
Rate My Photo

new
Journals
Folklore and Mythology
Business Coach
Marriage
Senior Living
Ethnic Beauty
Adolescence


dailyclick
All times in EST

Full Schedule
g
g ASP Site
Editor Wanted
BellaOnline's ASP Editor

g

Mailing an Attachment with CDO
Guest Author - Lisa Shea

If you're coding in ASP, you often are using it to mail out messages, including attachments. This can be a great way to share files with your visitors.

The syntax is very straightforward. In a form, you request the email address of the user. Then in your processing script, you would use:

Email = request("email")

Set objMail= Server.CreateObject("CDO.Message")
With objMail
.From = "webmaster@yoursite.com"
.To = Email
.Subject = "File You Requested from SiteName"
.TextBody = "Here is the file you requested from SiteName"
.AddAttachment "C:\files\filename.pdf"
.Send
End With
Set objMail = Nothing

==========================

The beauty of this is that the actual file location - the c:\files\ - is NOT on the web anywhere. That directory is completely separate from your web directories. That means no web surfer anywhere can get to these files. Only the people who use your online forms can have the files sent to them. That gives you some level of security, that only people who should see the files can get them.

However, keep in mind that as soon as a user gets their hands on a file, they could easily forward it to friends. But you can't really help that. At some point you need to realize that if a user can see a file, they can steal it if they want to. Heck, people scan entire books into their computers sometimes (i.e. Harry Potter) to share with friends. So at some point you have to accept that you've done the best you can as far as protecting your files. If someone goes through the effort to steal your work at that point, it is out of your hands.

Just make sure that the sent file is well branded with your site name and information, so at least the file itself always indicates where it came from!

This site needs an editor - click to learn more!

RSS | Related Articles | Previous Features | Site Map

Add Mailing+an+Attachment+with+CDO to Twitter Add Mailing+an+Attachment+with+CDO to Facebook Add Mailing+an+Attachment+with+CDO to MySpace Add Mailing+an+Attachment+with+CDO to Del.icio.us Digg Mailing+an+Attachment+with+CDO Add Mailing+an+Attachment+with+CDO to Yahoo My Web Add Mailing+an+Attachment+with+CDO to Google Bookmarks Add Mailing+an+Attachment+with+CDO to Stumbleupon Add Mailing+an+Attachment+with+CDO to Reddit


Content copyright © 2009 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor

g features
Best uses for RSS

RSS and its future.

Force Download Dialog box with ASP

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter

jobs
what
job title, keywords
where
city, state or zip
jobs by job search


vote
Growing a Garden
Veggies and Flowers
Veggies Only
Flowers Only
No Garden

g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2009 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor