CREATE 'EMAIL PAGE TO A FRIEND' WEB ELEMENT:

R

Ruth Allen

I need to create a web element which emails a web page or a URL link to a
designated email recipient. My client wants a link on her site called 'Email
this Page/Link to a Friend'. I can't find this code anywhere!

I'm sure I can figure it out or find it eventually, but some help asap would
save me a lot of time. You guys are great so thanks in advance!
 
T

Thomas A. Rowe

Do a search for:

JavaScript Email A Friend Script

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
T

Trevor L.

Ruth said:
I need to create a web element which emails a web page or a URL link
to a designated email recipient. My client wants a link on her site
called 'Email this Page/Link to a Friend'. I can't find this code
anywhere!

I'm sure I can figure it out or find it eventually, but some help
asap would save me a lot of time. You guys are great so thanks in
advance! --
Ruth Allen
EMBRACING TECHNOLOGY
embracingtech.com

Try this
function checkEmailAddress(field)
{
// the following expression in () after 'match' must be all on one line...
if
(field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
return true
else
{ alert('Please enter a valid e-mail address.')
field.focus()
field.select()
return false }
}
//-------------------------------
function mailThisUrl()
{
var subj = "I thought this might interest you..."
var text = "Here is an interesting Website: "
var content = "mailto:"
+ document.eMailer.address.value
+ "?subject=" + subj
+ "&body=" + text + "%0d%0a"
+ document.title
+ " (" + location.href + ")"

if (checkEmailAddress(document.eMailer.address))
window.location = content
}
//-------------------------------
<form name="eMailer" action="">
Email this Page/Link to a Friend<br />
<input type="text" id="address" size="30" />
<input type="button" value="Send" onclick="mailThisUrl()" />
</form>
 
J

jack.murphy

Ruth,

Check out www.Deliverent.com for a FREE no limit send-to-friend button
that you can deploy for your entire site.

Deliverent's send-to-friend technology is very powerful because one
script can work with your entire site. There is no page by page
configuration hassles. You install the script once for your entire
site and never have to worry about it again.

Deliverent creates the Send-to-friend button for you in pure
HTML/JavaScript code, so you can integrate with any website.

Other features include:
* the actual page (HTML, CSS and all) is emailed to the recipient
* multiple recipients
* built-in secure address book (for repeat senders)
* senders can opt-into your email e-newsletter (if you have one)

We also have a free "web page emailer" at www.jkn.com that you can use
to email any web page. This shares the same underlying technology as
www.Deliverent.com and should give you an idea to how powerful this
technology is.

I am a Deliverent/jkn representative, so your feedback would be much
appreciated. You can contact me at (e-mail address removed)

Regards,

Jack
 
R

Ruth Allen

This sounds VERY interesting. I checked out both sites. Thanks...But, I'm
not sure what I'm buying exactly...or what's free?...or where the code
is....help?
--
Ruth Allen
EMBRACING TECHNOLOGY
embracingtech.com


Ruth,

Check out www.Deliverent.com for a FREE no limit send-to-friend button
that you can deploy for your entire site.

Deliverent's send-to-friend technology is very powerful because one
script can work with your entire site. There is no page by page
configuration hassles. You install the script once for your entire
site and never have to worry about it again.

Deliverent creates the Send-to-friend button for you in pure
HTML/JavaScript code, so you can integrate with any website.

Other features include:
* the actual page (HTML, CSS and all) is emailed to the recipient
* multiple recipients
* built-in secure address book (for repeat senders)
* senders can opt-into your email e-newsletter (if you have one)

We also have a free "web page emailer" at www.jkn.com that you can use
to email any web page. This shares the same underlying technology as
www.Deliverent.com and should give you an idea to how powerful this
technology is.

I am a Deliverent/jkn representative, so your feedback would be much
appreciated. You can contact me at (e-mail address removed)

Regards,

Jack
 
R

Ruth Allen

Ok, Trevor, thanks...but, I have NO IDEA where to place this code within my
page...For example, you have an end form (/form) tag but I don't see the
beginning form tag.

Although I am an exceptional web designer, I don't claim to know everything
and I'm pitifully clueless on what to do with this wonderful code you've sent
me...as I can see it checks for valid email address and mails a URL and a
page?...help please!
 
T

Trevor L.

Ruth said:
Ok, Trevor, thanks...but, I have NO IDEA where to place this code
within my page...For example, you have an end form (/form) tag but I
don't see the beginning form tag.

Although I am an exceptional web designer, I don't claim to know
everything and I'm pitifully clueless on what to do with this
wonderful code you've sent me...as I can see it checks for valid
email address and mails a URL and a page?...help please!

No, it doesn't send the page itself, it places the URL of the page in an
Email so the body of the Email looks like this:
Here is an interesting Website:
Trevor and Carole's Home Page (http://tandcl.homemail.com.au/index.html )

As to what goes where:

This goes between <head> and </head>
function checkEmailAddress(field)
{
// the following expression in () after 'match' must be all on one
line... if
(field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi))
return true
else
{ alert('Please enter a valid e-mail address.')
field.focus()
field.select()
return false }
}
//-------------------------------
function mailThisUrl()
{
var subj = "I thought this might interest you..."
var text = "Here is an interesting Website: "
var content = "mailto:"
+ document.eMailer.address.value
+ "?subject=" + subj
+ "&body=" + text + "%0d%0a"
+ document.title
+ " (" + location.href + ")"

if (checkEmailAddress(document.eMailer.address))
window.location = content
}
//-------------------------------

The form (which does have a <form> tag) goes in between <body> and </body>

<form name="eMailer" action="">
Email this Page/Link to a Friend<br />
<input type="text" id="address" size="30" />
<input type="button" value="Send" onclick="mailThisUrl()" />
</form>

BTW, Deliverent is a free sevice. I think it is financed by the ads which
appear on the sent page.
I have a link to use it in my web page - it is marked
EMAIL THIS PAGE
As HTML

This sends the whole page as HTML. It works quite nicely, but there are two
points I think you should note:
1. Some people turn off HTML in their Email client.
2. You may only want to send a link to the page. My code does this.

Try either (or both as I have)
 
T

Trevor L.

Ruth said:
This sounds VERY interesting. I checked out both sites.
Thanks...But, I'm not sure what I'm buying exactly...or what's
free?...or where the code is....help?

Ruth,
I commented on Deliverent in my other post

I forgot to add:
It is free for a limited number per month. Their site tells you how many - I
think it is 1000's, certainly 100's

I have no connection whatsoever with Deliverent. I found it as you did- they
replied to this NG.
 
J

jack.murphy

Ruth,

Hi again. Deliverent currently provides two services. The first is a
send-to-friend button, which is 100% free and unlimited. The second is
an opt-in email service, which allows you to publish emails to opt-in
subscribers. The second service is free for 2,500 emails a month. After
that, we have various pricing levels to fit every budget.

You do not have to use the email publishing service at all. We have
many satisfied websites who just use the send-to-friend service and
nothing else.

When you become a Deliverent provider, you will be able to generate a
piece of HTML code which when you add to your website, will allow
people to click it and email your webpage to their friends. Nothing
could be simpler.

Regards

Jack
 
G

Gem_man

Hi Trevor,

You code seems to be exactly what I need.

I pasted the code in the places that you suggested but the code appreared as
text in preview and normal view. Also the code that was between the head tags
moved to between the body tags.

Is there something I have overlooked?

Thanks for your help
Gem_man
 
R

Ronx

Paste the code into Notepad, then copy and paste from Notepad into
Code/HTML View, not Design/Normal view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top