Solved

How to assign subject in mailto:

Posted on 2006-06-26
8
408 Views
Last Modified: 2012-06-27
I have a link which when clicked should open and email with to and subject pre_written

<td>By <a href="mailto:<%= next_successStory.getAuthor_email() %>"><%= next_successStory.getAuthor() %></a></td>

I know how to pre_write the to field but how can I pre_write the subject field

Any help will be greatly appreciated


0
Comment
Question by:huzefaq
  • 4
  • 2
  • 2
8 Comments
 
LVL 10

Expert Comment

by:TOPIO
ID: 16988383
Hi huzefaq,
Here's a good reference on the mailto syntax
http://www.ianr.unl.edu/internet/mailto.html
it  has details on the different  parts of the command


Cheers!
0
 
LVL 10

Expert Comment

by:TOPIO
ID: 16988388
The MailTo command can do more than enter a single e-mail address in the "Send To" field while activating your e-mail program. It can also:
Feature             Syntax
Address message to multiple recipients        ,   (comma separating e-mail addresses)
Add entry in the "Subject" field        ?subject=Subject Field Text
Add entry in the "Copy To" or "CC" field        ?&cc=id@internet.node
Add entry in the "Blind Copy To" or "BCC" field        ?&bcc=id@internet.node
Add entry in the "Body" field        ?&body=Your message here
Within the body use "%0A" for a new line,
use "%0A%0A" for a new line preceded by a blank line (paragraph),
see example below.
0
 
LVL 10

Accepted Solution

by:
TOPIO earned 250 total points
ID: 16988393
   MailTo with Subject
    <a href="mailto:astark1@unl.edu?subject=Comments from MailTo Syntax Page">
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 16988435
TOPIO,

I am not really sure what you are doing on that page or in the script but I would not include email addresses on a web page, especially since it looks like you may be including email addresses of others.  You expose yourself and/or the authors to spam messages.  Another downside is that support for mailto can be limited and if the visitor uses an online email account then it would not work.

A better alternative is to use a contact form that your script will send to the author or use the link to run a script that will send a generic email to the author.  In both cases the email is part of the script and hidden from visitors and those that would try to get personal information from your HTML code.  Which method you use would depend on if the email contents need to be customized by the visitor.

Let me know if you need more information about this suggestion.  I strongly recommend that you do not use mailto, especially if you will put someone else's email address in the code.

b0lsc0tt
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 10

Expert Comment

by:TOPIO
ID: 16989171
b0lsc0tt,
This is not my question, but you have a well written and important point
0
 

Author Comment

by:huzefaq
ID: 16993223
but I will not be inserting the email address directly in the code but will be getting it from the database using JSP.
Will that still be a problem

Thanks

0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 16993898
Your welcome!  Thanks for the additional information.  That sounds better.  If the email address is not in the HTML code then it will not be available to spammers, etc but it will still appear in the visitor's email program.  Also, in most cases, it will only work if the visitor has an email program installed on his computer.  It sounds like the JSP would be depend on client side script and that can be disabled in the browser.

Just a couple of other points to still consider.  Since you will not have other people's email addresses in your HTML code I would no longer strongly recommend against doing it but just suggest this other way.  Your current method may not work for people that have disabled client-side script, use a browser that doesn't support client-side script or mailto, or use an email account that won't work with it.

Let me know if you have any questions or would like more information.

bol
0
 

Author Comment

by:huzefaq
ID: 16994333
Thanks for the information b0lsc0tt, but the application I am working ion is an intranet application, so I guess it wouldn't be much of a problem.
But thanks again for all your help
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 to create a tile layout 1 36
Bootstrap css to change alignment without using padding 3 49
Centering a nested div 16 57
Enter key on html form page 11 46
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
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.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now