Forum Moderators: phranque
<script type="text/javascript">
<!--
var name = "user";
var domain = "yourdomain.com";
var subject = "your subject";
document.write('<a href=\"mailto:' + name + '@' + domain + '?subject=' + subject + '\">');
document.write(name + '@' + domain + '</a>');
// -->
</script>
Anyone know how to add the following:
1. title tag,
2. body content
3. change what is shown on the web page (link text, that is)?
I've tried, but js is definitely not kind to me :)
function mailer()
{
var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,ta='<a href=\"mailto:';
e='</';
f='yourname';
c='\">';
g='yourdom';
e+='a>';
j='?subject=';
f+='@';
h='ain.com';
p='\" alt=';
k='The Message Title';
m='<img';
l='The Link Text';
s='&body=';
n='The Image Filename';
p+='\"';
t='The Body Text';
q='Email.'
r='\"'
m+=' src=\"'
r+=' border=\"0\">'if (f) if (g) if (h) i=f+g+h;
if (k) b=i+j+k+s+t
else b=i;if (n) o=p+q+r;
if (l) d=l
else if (n) d=m+n+o
else d=i;document.write(a+b+c+d+e)
}mailer()
Fill in the Required Link Text in (l) OR an Image Filename in (n) else the Link Text will be the actual email address shown on screen (non-spiderable though!).
The domain is split across two variables, (g) and (h) so that even just the domain can't be easily reassembled in its own.
Fill in the Message Title and the Message Body Required too. If Message Title is blank, then no Message Title or Mesage Body will be appended.
.
This is the required HTML snippet that calls the javascript funtion:
<p><script type="text/javascript" language="javascript1.2" src="/js/mailer.js"></script></p>
<noscript><p>Send email to <a href="contactform.html"
title="Fill in the Feedback Form">The Business Name</a></p></noscript><p>or simply fill in the <a href="contactform.html"
title="Fill in the Feedback Form">Feedback Form</a>.</p>
The user sees the email link if javascript is enabled, or gets a link to the contact form page where they can fill in the form if javascript is not enabled.
Autorespond with a 'reply to this email for confirmation', and make the reply email a different email address.
Only add those to the newsletter who reply to the autoresponder email - it'll save you time signing up spammers.
formmail also has an easy way to add a form to your site that they host for not a lot of $$ a month, this could be another way to build your list without having your email displayed anywhere in the page to try and protect the inegrity of your list.