Solved

Mailto Tag

Posted on 2004-08-27
4
621 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

706 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

16 Experts available now in Live!

Get 1:1 Help Now