473,379 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

RFC: Building a Web Mail Application with Attachment Capability

I'm developing a very small Web-based mail application as part of a
larger Online Contact System for a client. I was struggling for a few
hours with how to handle e-mail attachments and I thought I'd post my
solution to see if there are any better solutions out there.

My thoughts are that I would use associate each response with a
System.Guid.NewGuid() and then as the message is created, the app
would create a directory in the temp folder with the Guid as the
directory name. As users upload attachments, the files would be saved
in the message's directory. This stops one of my problems which was,
if you have one shared temporary file directory, how do you preserve
the name of the attachment if the same filename is attached to
multiple messages by one user or multiple users attach a file of the
same name at the same time.

To handle the removal of the files, it could be implementation
specific, such as the message's directory could be removed on sending,
if no archiving is necessary, or the message directory could be
removed when the message is removed.

I am aware of the CDO and the ability to attach files from memory, but
users will be able to view many pages before the message is actually
sent, and I dont' want all those attachments hanging around in Session
variables or ViewState for that long - it seems like a huge waste of
resources especially if 100 people are working on the system attaching
files.

I really would appreciate your thoughts and comments.

Chris
http://www.chriswelch.com/
Nov 18 '05 #1
1 1399
Chris,

Your solution sounds fine to me.

An alternative would be to store the files in a database. I don't really see
any major benefits to that over your solution though.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Chris Welch" <ma******@webnautica.net> wrote in message
news:67*************************@posting.google.co m...
I'm developing a very small Web-based mail application as part of a
larger Online Contact System for a client. I was struggling for a few
hours with how to handle e-mail attachments and I thought I'd post my
solution to see if there are any better solutions out there.

My thoughts are that I would use associate each response with a
System.Guid.NewGuid() and then as the message is created, the app
would create a directory in the temp folder with the Guid as the
directory name. As users upload attachments, the files would be saved
in the message's directory. This stops one of my problems which was,
if you have one shared temporary file directory, how do you preserve
the name of the attachment if the same filename is attached to
multiple messages by one user or multiple users attach a file of the
same name at the same time.

To handle the removal of the files, it could be implementation
specific, such as the message's directory could be removed on sending,
if no archiving is necessary, or the message directory could be
removed when the message is removed.

I am aware of the CDO and the ability to attach files from memory, but
users will be able to view many pages before the message is actually
sent, and I dont' want all those attachments hanging around in Session
variables or ViewState for that long - it seems like a huge waste of
resources especially if 100 people are working on the system attaching
files.

I really would appreciate your thoughts and comments.

Chris
http://www.chriswelch.com/

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: PeterR | last post by:
I've spent weeks trying to write a function that is simple to use for sending emails with attachments, but I my programming skills are not that advanced. I've noticed a few postings in these...
2
by: knoak | last post by:
Hi there, I've found a script at these great Google fora. a script to send emails with attachments. The script is below this message, name etc. aren't mine, but from the original post. My...
6
by: rekaeps | last post by:
We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles sending e-mail from the server when accessing the web site from a separate client computer. Also, in the same scenario,...
3
by: dnuos | last post by:
We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles sending e-mail from the server when accessing the web site from a separate client computer. Here's some details: ...
5
by: Robert Dufour | last post by:
I am trying to use framework 1.1 - stuck with it. to send emails from a windows form application. The email messages can have attachments, usually two and they can be either text or sounds (wav...
1
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an...
2
by: eng.sharif | last post by:
hi group how i can send mail and attachement in php with "mail function " $s = mail($to,$subject,$cont, $headers); can anyone help
2
by: Ruud | last post by:
Just before leaving for a holiday my collegue modified this script. Now it won't send any body text (The data filled in on the form) and in an error condition it won't send any attachments either....
1
by: nukephp | last post by:
Hello Guys would you know about php email with his attachment Working on linux platform................................................... The code as below: mail.php <?php //define the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.