Support » Fixing WordPress » E-mail Link

  • Can anyone tell me how to add a “mail this post” link (WP1.2)? I have search for this but the only real “plug in” I can find is for 1.5 I also found this:

    “index.php in my theme dir with this code for the loop (in the <p class=”postmetadata”> section):

    : <?php the_title(); ?>&body=You might consider reading this: <?php the_permalink() ?>”>Send 2 friend |

    As you can see, this basically just adds a mailto: link which calls the blog and post title for the subject line and adds a little body – everything else is left to the default mail client on the system. I think that’s no bad idea at all. You can see it action on my site http://www.teezeh.info

    But my index.php file does not contain anything like a “<p class=”postmetadata”>” section.

    Help??
    Thanx
    DD

Viewing 7 replies - 1 through 7 (of 7 total)
  • The post meta data section is found in different places, depending upon your Theme. Key places to look would be in the sidebar.php and single.php.

    To create a link with a “mailto” in it, using the email template tags, inside of one of your template files, like the footer.php or sidebar.php, create the following link:

    <a title="Email us" href="mailto:<?php bloginfo('admin_email'); ?>?subject=Hello%20from%20My%20site">Email us</a>

    or this:

    <a title="Email us" href="mailto:<?php the_author_email(); ?>?subject=Hello%20from%20My%20site">Email us</a>

    To use such a link within a post, you will have to enter in the email address like this:

    <a title="Email us" href="mailto:sally@somewhere.com?subject=Hello%20from%20My%20site">Email us</a>

    Just wanted to add to this that you should really use the built-in antispambot function, since it does protect you a little bit from spammers!

    <a title="Email us" href="mailto:<?php echo antispambot(get_the_author_email()); ?>?subject=Hello%20from%20my%20site">Email Us</a>

    Jbbrwcky

    Thanx. I hope i was nor unclear on my question. What I want is a link on each post so that the reader can click in it to e-mail it to someone else, not to me. as in this blog where there is a small envelope icon at the bottom of each post.

    Thanx Again

    DD

    The Blue Radiant theme – http://www.hpnadig.net/blog/index.php/archives/2005/03/23/blue-radiant-theme/ – has this as part of the theme, but you should be able to move the necessary files into any other theme. You’ll need to put the email.php file and the image file in appropriate directories and then copy the code from the “Main” template file into your main template file. I was able to adapt everything from that theme to the one on my blog ( http://www.tom-hanna.org ) and not mess it up too bad, so I’d guess almost anybody ought to be able to do it.

    I got this to work, thanks…

    you need to add:

    email_process.php
    email.php

    to your wp-content/themes/youthemename/

    folder…

    and add the following line from the blue_radient index.php to your theme index.php where you want the link:

    line starts:

    <a href=”javascript:void …

    and ends:

    title=”Email this post”>

    and a trailing end anchor (bbpress is filtering it out)

    How do I set up the “From” field, so that the receiver does not get some funny characters, including the name of my host.

    Also, is there a way to ensure that international characters are supported?

    Where did you find the Plug-in I am running 1.5 and would like it..

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘E-mail Link’ is closed to new replies.