Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mailto form with attachment

Posted on 2001-07-19
13
Medium Priority
?
4,228 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
ID: 6300783
Impossible for mailto.
Read this mailto documentation.
http://developer.iplanet.com/viewsource/husted_mailto/mailto.html


hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6300784
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
ID: 6300795
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Expert Comment

by:hongjun
ID: 6300807
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
ID: 6300813
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
ID: 6300823
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
 
LVL 17

Expert Comment

by:dorward
ID: 6301485
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 200 total points
ID: 6302163
Any progress?

hongjun
0
 
LVL 3

Expert Comment

by:MHQ
ID: 6302661
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
ID: 6302861
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
ID: 6302875
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
ID: 6302923
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
ID: 6303033
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

926 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