Solved

Mailto Tag

Posted on 2004-08-27
4
626 Views
Last Modified: 2008-02-01
Is there a way to send an image with a mail to tag...

The idea is as follows... user enters in there email address, subject and a picture...

These details are stored in a database...

The Mailto Tag will then look something like
<Mailto:ResultVariable(0)Subject?<ResultVariable1>
I then want another <Result variable> which will send the image...possibly a link that will show in the main part of the email...
e.g www.mysite.com/<ResultVariable(3)>

hope this makes sense?

0
Comment
Question by:Kegan5
  • 2
4 Comments
 
LVL 10

Expert Comment

by:rockmansattic
ID: 11912325
No, definitly not directly.   Mailto simply calls a javascript in the browser that opens a message with the default mail client.  

I suggest using php or asp to do this.  Check your ISP to see which (if either) youcan run.  Both are rather easy to setup, Plus mailto is not reliable.

Rockman
0
 
LVL 13

Expert Comment

by:flow79
ID: 11913131
If you have access to ASP, i great mail script (including attachment) is as follows:

preemail.asp ---------------------------------

<html>
<head>
<title>Untitled</title>

<style type="text/css">
<!--

body { font-size: xx-small; font-family: verdana; }
table { font-size: xx-small; }
input { width: 350px; border: 1px #999999 solid; }
textarea { width: 350px; height: 125px; border: 1px #999999 solid; }

-->
</style>

</head>
<body>

<%

Dim oConnA
Dim DB,DRIVER

Set oConnA=Server.CreateObject("ADODB.Connection")

oConnA.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=\\coriolis\inetpub\wwwroot\CTC Plant Air Orders.mdb;"

Dim ReferenceID
ReferenceID = Request.QueryString("ReferenceID")

%>
<form method="get" action="email.asp">
<input type="hidden" value="<%= ReferenceID %>" name="ReferenceID">
<table summary="">
<tr>
<td><b>Enter the Receiving Email:</b></td>
<td>
      <input type="text" name="email"><br>
</td>
</tr>
<tr>
<td></td>
<td>To enter more than one email, simply put a<br> semicolon (;) between the addresses.</td>
</tr>
<tr>
<td valign="top"><b>Enter your Message:</b></td>
<td><textarea name="message"></textarea></td>
</tr>
<tr>
<td></td>
<td>
<b>Common HTML Codes:</b>
<table summary="">
<tr>
<td><b>Bold</b> &lt;b&gt;text&lt;/b&gt;</td>
<td><b>Underline</b> &lt;u&gt;text&lt;/u&gt;</td>
<td><b>Line Break</b> &lt;br&gt;</td>
</tr>
<tr>
<td><b>Italic</b> &lt;i&gt;&lt;/i&gt;</td>
<td colspan="2"><b>Link</b> &lt;a href="URL"&gt;link text&lt;/a&gt;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Submit">
</td>
</tr>
</table>
</form>

</body>
</html>



email.asp ----------------------------

<%

Dim ReferenceID
Dim Message
ReferenceID = Request.QueryString("ReferenceID")
Message = Request.QueryString("Message")
'** SUBROUTINE TO SEND EMAIL USING CDOSYS **

strMailBody = ""&Message&""

strTo=Request.QueryString("email")

' just fill in the appropriate values in From, yourSMTPserver, and yourattachment.extension
CALL SendMailCDOSYS("From", strTo, "Title", strMailBody, True, "yourSMTPserver","yourattachment.extension")



Sub SendMailCDOSYS(strFrom,strTO,strSubject,strMailBody,blnHTML,sMailServer,sAttachPath)
On Error Resume Next
     Dim objCDOConf,objCDOSYS
     ' ** CREATE THE E-MAIL SERVER OBJECT **
     Set objCDOSYS = Server.CreateObject("CDO.Message")
     Set objCDOConf = Server.CreateObject ("CDO.Configuration")

     ' ** SET AND UPDATE FIELDS PROPERTIES **
     With objCDOConf
          ' ** OUT GOING SMTP SERVER **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer
          ' ** SMTP PORT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")  = 25
          ' ** CDO PORT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          ' ** TIMEOUT **
          .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
          .Fields.Update
     End With

     ' ** UPDATE THE CDOSYS CONFIGURATION **
     Set objCDOSYS.Configuration = objCDOConf

     With objCDOSYS    
          ' ** WHO THE E-MAIL IS FROM **
          .From = strFrom

          ' ** WHO THE E-MAIL IS SENT TO **
          .To = strTo
                   
          ' ** THE SUBJECT OF THE E-MAIL **
          .Subject = strSubject
           
          ' ** SET THE E-MAIL BODY FORMAT (HTMLBody=HTML TextBody=Plain) **
          If blnHTML = True Then
          .HTMLBody = strMailBody
          Else
          .TextBody = strMailBody
          End If
               
               ' ** SET Attachments If any **
            If sAttachPath<>"" Then
            .AddAttachMent (sAttachPath)    
            End if
           
          ' ** SEND THE E-MAIL **
          .Send
     End with                    
       
     ' ** CLOSE THE SERVER MAIL OBJECT **
     Set objCDOSYS = Nothing
End Sub

Response.Redirect "yourpage.asp"

%>
0
 
LVL 4

Expert Comment

by:mrdilliard
ID: 12072050
you could send an image tag over the mailto, I believe...

<a href="mailto:someone@yoursite.com?body=<img src='http://www.squirreltweezers.com/images/yes.gif' />">Link here</a>

All that's going to do is make it link to the image on your site, but that would work, in theory.
0
 
LVL 4

Accepted Solution

by:
mrdilliard earned 30 total points
ID: 12072068
further clarification...

General form of a mailto a tag.

<a href="mailto:email@yoursite.com?subject=such and such&body=blah blah blah&cc=carbon copy!&bcc=blind carbon copy">Link</a>

I think that's everything you can do in a mailto tag...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Wordpress plugins not working in html 3 38
need to fire confirm() popup window in IE using VBA 2 22
Can't get js include to work in html file 8 20
VBScript on Html 15 47
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.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

839 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