SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: How to . . .???

  1. #1
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to . . .???

    I know I've seen how to do this, but I can find it in my notes anywhere....

    How do I make a link on a webpage so when people click on it their e-mail client opens up and the subject, and message body is automatically filled in (I would be able to control the subject, and message in the body of the e-mail message....unless they change it, or course)

    I was going to do a CGI sendmail set-up, but I this will be safer, and provide less chances for spammers, and pranksters to misuse the system.

    I basically want to use it on a website, where folks can recommend my site using their own e-mail client.

  2. #2
    :) Have a nice day! james34's Avatar
    Join Date
    Jun 2000
    Location
    KY, USA
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The subject part is easy but I,m not sure about the body of the message.
    a href="mailto:yourname@yourdomain.com?subject=your subject"
    james34
    My Site

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I quickly threw together a script for you that will generate the code automatically. Read: I hacked this together in 2 minutes, and I know it's not perfect. I'll work on it some more tomorrow, but now I'm off to bed, so g'night.

  4. #4
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the tips. I may have to use James' idea to start out with. As far as the PHP form, I don't have the e-mail address of who it would be going to. That's going to change everytime someone on my site wants to notify a friend about it.

    What James has would work great, If I could figure out how to rig it where there is a default message in the body that way when the click on my link, the subject & message is already there by default.

  5. #5
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just be careful with leaving email addresses on pages - they tend to get picked up and spammed , personally Matt's way is a lot better

    (BTW Matt, I like your site! )

  6. #6
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, the generator has been overhauled, err... updated. If you see any problems with it, please let me know.

    What James has would work great, If I could figure out how to rig it where there is a default message in the body that way when the click on my link, the subject & message is already there by default.
    Uh-huh... The script that I made does just that. It generates all the code you need for advanced mailto: links. Did you even try it out to see what it does?

    BTW Matt, I like your site!
    Thanks.

  7. #7
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I tried it and it appeared to need an e-mail address to send the message to which I don't have.

    That would have to be put in each time by the person recommending my site.

    Unless, you're thinking I should use the code & make a page using PHP so vistors can simply fill in the blanks to recommend my site.

    I know nothing about PHP. I'm just now getting the hang of configuring Perl scripts for use. But, I guess I could copy & paste if that's all I need to do to make it work.

    My host supports PHP, so I guess it would work.

  8. #8
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK....No I've got it!

    I just put "Friends address here" where the e-mail address would go. This way the link your page generated works fine, as long as the person using it has sense enough to notice that they have to manually type in their frind's e-mail address.
    I think most people will understand this.

    Thanks a ton. This'll will be very a simple, yet very useful way to allow people to recommend a website without having to worry about spammers misusing it.

  9. #9
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Matt,

    How long are you going to leave that page up?
    I bookmarked it, but didn't want to waste any of your bandwidth so I was trying to re-create it on my server.

    I copied everything exactly like you had it on your page, but it not work. Maybe it's because I no nothing about PHP.

    Is there anything special I'm supposed to do to my server to activate PHP scripts? (Like CHMOD on Perl)

  10. #10
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That page will be there for as long as my site is online. I'm making a habit of storing some of my more recent scripts in /php. And I appreciate your thoughtfulness regarding my bandwidth.

    You can't just view source and copy-n-paste with PHP, though. All the code gets processed on the server before it even hits your browser, so you'll need the page source. Now that you can copy-n-paste into your_file_name.php (call it whatever you want *.php) and upload it.

  11. #11
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    KooLness....

    I appreciate it.
    This is a great way to set up custom "Recommend This Site" links for specific sites where the site owner can even control some of the content in the message.

    I did notice that the CSS style doesn't work in NS4. I always test in that old browser since if it looks good there, it'll look good anywhere.

    I've seen other sites that were totally controlled by CSS that looked the same in NS4 as they did in IE6. Is there some trick to that?

    I've heard the old NS browsers don't do CSS very well.
    Just wondered if you knew of any tricks to make CSS work there.

  12. #12
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I purposely used @import to disable my style sheet in NS4 and other old browsers. They just choke too hard on what I'm using.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •