Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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).

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.

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.

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!

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top