Solved

mailto form with attachment

Posted on 2001-07-19
13
4,209 Views
Last Modified: 2007-11-27
using something like the code below, you can change the message subject, body, cc, etc on a mailto form.

anybody know of a way that I can also have the email attach a file from the root of the site?

mailto:name@domain.net?subject=RE:%20Your%20Subject%20has%20been%20changed

0
Comment
Question by:1cell
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Impossible for mailto.
Read this mailto documentation.
http://developer.iplanet.com/viewsource/husted_mailto/mailto.html


hongjun
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Below will tell you how to send email using coding.
Please note that normal HTML will not be able to achieve sending an email with attachments. In HTML we use mailto and that only restricts us in the To, Cc, Bcc, Subject and Body field. To send an email with attachments, you need to use a server-side scripting language. I will show you how to do that in Active Server Pages (ASP). That means you will need a web server.

If you are using Win NT or Win 2000 and have CDONTS.dll installed, then you can do the following using Internt Information Server (IIS) as your web server.
<%
Dim objMailer
Dim strBody

' You can have HTML tags here
' You can therefore customize the format you want to send
strBody = "<TABLE BORDER='0'><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>"

Set objMailer = CreateObject("CDONTS.Newmail")
objMailer.From = "sender@domain.com"
objMailer.To = "receipent@domain.com"
objMailer.Subject = "Your subject here"
objMailer.BodyFormat = 0
objMailer.Mailformat = 0
objMailer.Body = strBody
objMailer.Send
Set objMailer = Nothing
%>

If you wish to include an attachment, below is the syntax
objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )

See this for more information on CDONTS.
http://msdn.microsoft.com/library/psdk/cdo/_denali_newmail_object_cdonts_library_.htm

If you do not have IIS because you are not running ntfs partition, then you will need to download a web server and I recommend you using Personal Web Server (PWS). Download it at http://www.microsoft.com/ntserver/nts/downloads/recommended/nt4optpk/default.asp. Note that PWS will not be able to support CDONTS.

If you are using other versions of Windows, then you got to install a server component. I recommend using AspEmail. It can be downloaded from http://www.aspemail.com
To learn how to code using the AspEmail component, you can download its user manual from the site itself. It is very comprehensive and complete. There's even an asp example page showing that.

Good Luck
hongjun
0
 
LVL 6

Author Comment

by:1cell
Comment Utility
thanks for the quick input.  sorry I wasn't clear enough, I've been at this too long today.  let me describe my situation a bit better.

this page will be contained on a CD, not a server.  Thus, unfortunately, no server side anything will do it.  is there no client side script that can do this??????

i understand that normal HTML wouldn't do this but I am wondering if there is a way with Javascript (or other client side script) in which this could be done.

thanks again
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
There's no way you can do that in client side. Perhaps you could wait for other experts to comment on this.

hongjun
0
 
LVL 6

Author Comment

by:1cell
Comment Utility
well thanks for the input anyway.  i thought posting this in the HTML section would get a broader group of experts but perhaps I should post it in the javascript section.
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Simple. Post another question like this

Subject: Link to mailto question
Point: 0

Include a link to this question in the new question.


hongjun
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 17

Expert Comment

by:dorward
Comment Utility
Don't use mailto: anyway! http://www.isolani.co.uk/newbie/mailto.html

Take a leaf out of O'reillies CD Bookshelves - put a Java webserver on the CD (then you have have a search engine too!)
0
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
Comment Utility
Any progress?

hongjun
0
 
LVL 3

Expert Comment

by:MHQ
Comment Utility
1cell:

As most experts have mantioned, there is no way of doing this client side. The closest have been putting a javaserver on the CD but my guess would be that most users would object loudly to having it run on their machine possibly against their will.

My solution would be to use mailto in relular HTML and then add a comment asking the user to attach the file stating the path and name of it and some direction on how to do this in a common way for mailprogram.

/MHQ
0
 
LVL 6

Author Comment

by:1cell
Comment Utility
i don't believe I'll be putting Java weberver on the cd, partly because even though I have 600MB worth of space to work from, the footprint needs to be very economic.  I also fear the possibilities of running the server on unknown environment variables as well as the fact the point which was made that some people might not feel safe running a server, even temporarily.

thanks for all the input regardless.  It baffles me that there's no way to do this.  I was always taught, "anything you wanna do."  I suppose it's true but not on a static page.  
0
 
LVL 3

Expert Comment

by:MHQ
Comment Utility
I think the saying goes "anything you wanna do, you can do... but you'll have to sell your soul for some of it" =)
0
 
LVL 6

Author Comment

by:1cell
Comment Utility
i've accepted hongjun's cmoments as an answer simply because he was the first one to say, "you can't" and still stuck around to try to help.  I appreciate everyone else's help too.

0
 
LVL 6

Author Comment

by:1cell
Comment Utility
if I sell my soul can I do it on a static page?  what if I already sold it?  can I sell my mojo?
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now