[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 668
  • Last Modified:

Mailto Tag

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
Kegan5
Asked:
Kegan5
  • 2
1 Solution
 
rockmansatticCommented:
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
 
flow79Commented:
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
 
mrdilliardCommented:
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
 
mrdilliardCommented:
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: 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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now