Solved

Attach image file to mailto form

Posted on 2001-06-20
14
1,267 Views
Last Modified: 2007-12-19
  How do I get a mailto form open a box or whatever to allow image to be attached to emailed form before sending?
0
Comment
Question by:Bob Stone
  • 5
  • 3
  • 3
  • +2
14 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6212285
The only way you can do it with mailto is by simply creating the email message for the user and leaving it open so that they can attach the file and then click send.

To do that, set up a mailto: link e.g.

<a href="mailto:name@address.com">send email</a>

You can't do it by using mailto with forms...

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6212300
For more info on mailto i.e. how to specify a subject, CC etc. look at:

http://developer.netscape.com/viewsource/husted_mailto/mailto.html

For much more control you will need to use a server-side script - I have done the kind of thing you are asking in PHP - it isn't that difficult. You just need to make sure you have a webserver that supports server-side scripting!!

Hope this helps.

Ant
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6212507
There's no way mailto can help you. As commented above, it can only allow you to state the To, Cc, Bcc, Subject, Body, etc simple attributes.

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 do not have IIS, 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 33

Expert Comment

by:hongjun
ID: 6212511
The below is the syntax of attaching a file.

objNewMail.AttachFile(Source [, FileName] [, EncodingMethod] )

To send multiple files, simply repeat the above coding many times while changing the file to be sent.

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6212520
Use the below example code to do email sending in AspEmail.

<%
   Dim objMail

   Set objMail = Server.CreateObject("
   objMail.Host = "your_smtp"  ' SMTP Outgoing Server
   objMail.Port = 25  ' Optional (Default is 25)
   objMail.From = "sender@domain.com" ' From Address
   ' Optional but is recommended
   objMail.FromName = "Sender Name"
   ' Name is optional
   objMail.AddAddress "receipent1@domain.com", "Receipent1"
   objMail.AddAddress "another_pple@hotmail.com", "Another Person"
   ' CC Address (Optional)
   objMail.AddCC "cc_person@hotmail.com"
   ' BCC Address (Optional)
   objMail.AddBcc "bcc_person@hotmail.com"
   ' Subject of Email
   objMail.Subject = "your_subject"
   objMail.Body = "You body"
   ' True means HTML send
   objMail.IsHTML = True
   ' Attach files if it is checked
   objMail.AddAttachment "C:\windows\desktop\your_file1.exe"
   objMail.AddAttachment "C:\windows\desktop\your_file2.exe"
       
   ' send email
   objMail.Send
   ' errors occured
   If Err <> 0 Then
       Response.Write "Status: Mail Not Sent"
   ' no errors occured
   Else
       Response.Write "Status: Mail Sent Successfully"
   End If

   Set objMail = Nothing
%>

For more information of the coding. Download user manual from http://www.aspemail.com/Manual.htm

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6212522
Sorry please replace my third line of the above AspEmail code with this

Set objMail = Server.CreateObject("Persits.MailSender")

hongjun
0
 
LVL 33

Expert Comment

by:hongjun
ID: 6212525
If you are not using Asp, then go to http://www.hotscripts.com

There's a lot of other examples using PHP, Python, etc.

hongjun
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Author Comment

by:Bob Stone
ID: 6215446
I am on my ISP server, and I know squat about ASP. I did however find a cgi that will do that, sort of. I will post another Q soon re that.
0
 
LVL 9

Author Comment

by:Bob Stone
ID: 6228855
  I am going to delete this Q, I think I may have found a more feasable(sp?) way to do this. I will post another Q soon, if needed.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7089823
Hi stone5150,
You've requested to delete this question, but its status has remained as 'Pending Delete' because one or more comments have been added.  Normally, the only way to fully delete such a Question is to post a message to Community Support and ask for assistance.

EE is making a one-time database sweep to purge the Pending Delete Questions automatically.  During this sweep:

    stone5150 -- To allow the deletion to proceed:  Do nothing.
    EXPERTS -- Please DON'T POST a comment except to contest this deletion.

In the future, please refer to http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#8 for instruction on deleting questions.

DanRollins -- EE database cleanup volunteer
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 7089870
mmm....not sure....I think we provided some useful info here...

Ant
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7091219
Listening for responses here.
Moondancer - EE Moderator
0
 
LVL 9

Author Comment

by:Bob Stone
ID: 7092743
They wouuld have been useful if I had a clue about ASP, which I don't I have since written some CGIs to handle it. Check my profile for these Q which were answered and points given.
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 7092842
200 points refunded, item moved to PAQ at zero and closed.

It would help tremendously, Stone, for you to post cross-reference link on such issues and ask us to help you when comments have been added and subsequent deletions requested (for future items).

Moondancer - EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I   ajax html table  rows? 20 63
Wrapper for APPs 9 36
Change javascript css 1 19
bootstrap footer centering and expand problems 7 29
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

14 Experts available now in Live!

Get 1:1 Help Now