13

I need to create a "forward to friend" link in a HTML email that will mimic the forward button on the mail client (ie launch a new window with a pre-filled body), is this possible?

ie:

<a href="forward-action">Forward this email to a friend</a>

If not, what's a simple approach to achieve an as similar as possible result?

ps. I'm aware this is pretty much pointless functionality, it's a request from client.

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Marty
  • 39,033
  • 19
  • 93
  • 162

6 Answers6

10

I wonder if your client would go for this:

  1. create a jazzy Forward to a Friend button.

  2. that button should open up a page on the client site.

  3. that page should contain an email a friend form.

Much easier to accomplish.

Jason Gennaro
  • 34,535
  • 8
  • 65
  • 86
  • 1
    Thanks for noticing the line in my question suggesting that other solutions will be fine, they're happy enough with this idea. – Marty Sep 28 '11 at 04:31
  • Would there be a way to trace who the original email went to, i.e. pass that info (invisibly maybe) to the webpage with the form? That we would know who were good promotors on our list of professionals and if there was a problem with the addresses we could contact them, often we have their details in our DB. We'd be manually sending them out from the web form details at this stage, even though we have – wide_eyed_pupil Sep 19 '12 at 05:08
9

You cannot imitate or initiate the forward action in any mail client (web or desktop) currently on the market today. You have several other options available though:

  • Offer an online version of your email and include a link to it in your mailto tag:

    <a href="mailto:Enter%20an%20email?subject=Your%20Subject%20Line&body=Thought%20you%20might%20be%20interested%20in%20this%20http://www.yourdomain.com">
    Forward to a friend</a>
    
  • Include a callout in your email (near the top, preferably) encouraging your recipients to forward the message to their friends.

  • Include a link to a web form where your recipients can provide other people's email addresses and send these new email addresses copies of the mailing. (The only issue with this one is that the recipient's address book is not available to them easily, which probably hinders sharing - test to know what your demographic is like).

Halogen
  • 551
  • 6
  • 11
Sean Vieira
  • 155,703
  • 32
  • 311
  • 293
4

No, this is not possible. At least, I really, really, really hope it's not possible.

Why? Because if it was possible, spammers could put links in e-mails that might cause people to unintentionally forward something. For this reason, forwarding has to be self-instigated by the user with the functionality provided by their e-mail client.

You can have links that use the mailto protocol, like this

<a href="mailto:person@example.com">Link</a>

but this probably isn't what you are looking for. All this does is open the compose mail page with the e-mail field filled in (assuming that their default e-mail client is configured to do so).

You could do something like this:

<a href="mailto:person@example.com?subject=FW: Email Subject
&body=Body of email text
&cc=anotherperson@example.com
&bcc=onemore@example.com">Forward email</a>

And fill out all the fields in the compose mail dialog, but there is nothing you can do that emulates the forwarding functionality.

Peter Olson
  • 139,199
  • 49
  • 202
  • 242
  • True, though I'm trying to mimic actually pressing the forward button, ie launching a new email window with the content of the current email where the recipient can define new recipients from there; which would all be self-instigated. – Marty Sep 27 '11 at 23:49
2

If you can extract from HTML email client Subject and Body of the email then you can do this:

<a href="mailto:person@foo.com?subject=..extracted subject...&body=...extracted body...">Forward</a>

One major minus is your whole URI inside 'a' can not be longer then 1024 characters. Oh and don't forget to URL escape subject and body when composing URI string.

Marty
  • 39,033
  • 19
  • 93
  • 162
Andrei V
  • 1,468
  • 3
  • 17
  • 32
0

Forwarding is not possible.

But I've done some research on the same like as I wanted to promote an event.

I've create this following link,

<a href="mailto:?&amp;subject=Webinar%20on+Leveraging+Artificial+Intelligence+to+Build+Algorithmic+Trading+Strategies&amp;body=Check%20out%20this%20webinar%20on%20developing%20robust%20quantitative%20trading%20strategies%20using%20AI.%20http%3A//bit.ly/1MqTMzg" target="_blank">Spread the word</a>

Hope it helps!

-1

I am not a web developer, but just writing web pages for myself. I have stopped directly putting email addresses into html in order to avoid being captured by bots for spamming purpose or whatever it may be.

I wrote a simple js to concat pieces of information together instead:

function ml(name, dom, sub, body) {
  var mailname = name + "@";
  var nl = "%C2%A0%0A";
  var nlcol = "%3A" + nl;
  var dom = dom + ".";
  var msg = "mai" + "lto:" + mailname + dom + "com" + "?subject=" + sub + "&body=" + body;
  window.location.href = msg;
}

in the html:

<a onclick="ml('emailName', 'domain Name', 'subject string', 'greeting in content or any text in content')" >
    <input type="button" value="Share with a friend">
</a>
derloopkat
  • 6,232
  • 16
  • 38
  • 45