Forum Moderators: open

Message Too Old, No Replies

Script for virtual postcards

How do you send postcards from your website?

         

feemgh

1:38 pm on Nov 6, 2002 (gmt 0)

10+ Year Member



The Scottish Tourist Board website and a few others, that I have come across, allow you to send postcards to friends. You choose an image, add their email address and write a little message...then press the send button...

Can anyone explain to me how you do this?

Sorry I am new to web design and coding so any help would be greatly appreciated.

Thanks

fee

Mardi_Gras

1:42 pm on Nov 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might start at www.hotscripts.com - a search for "postcards" turned up quite few options.

Good luck.

feemgh

10:59 am on Nov 7, 2002 (gmt 0)

10+ Year Member



Thanks - I had a look at the freeware listed and its not exactly what I want.

I would like a visitor to send a postcard of the site to a friend if he/she thought it would be of interest to them.

The friend would receive an html email with a photo and a bit of text from the visitor with a link to the site.

That's really what I would like to know how to do. Sorry I didn't explain myself at the outset.

Hope someone can help.....

fee

BlobFisk

12:21 pm on Nov 7, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is something that you could put together yourself using a server side language like ASP, JSP or PHP etc.

The above langauges have pre-installed email creation and sending components which allow you to format the body etc. of your email, in which you could set the link of the image (based on the users choice) and insert the link. It is starightforward enough (assuming you know the language!) depending on the level of complexity you wish to include.

  • User chooses image x --> Variable inserts img link for image x

  • Link automatically gets inserted

  • User types comments into text field --> email creation page reads in the info from the text field and inserts it into the email.

  • The page would insert the email of the friend and senders email from the info. it pulled from the postcard page

  • Page sends on the email and displays a nice "Your email has been sent" page.

    Is this what you had in mind?

  • feemgh

    12:56 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    Yes thanks BlobFisk that's exactly what I had in mind...

    I have no experience in any of the languages you mentioned. Is there a tutorial somewhere that would explain how I can do this?

    Thanks

    fee

    BlobFisk

    1:18 pm on Nov 7, 2002 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Well, I'll use ASP as an example here (as it's the one I know best!) but this would depend on your server/ISP. If your using a Windows NT/2k server, ASP is the usual method (although it's easy to install a Perl or PHP environment, JSP is a little more involved). For *nix systems, Perl or PHP are the more common.

    Anyhow, you can get some nice ASP tutorials at www.asp101.com [asp101.com] and www.aspin.com [aspin.com] to name just two.

    The area's to look into are:

  • Reading info from a form and assigning a variable to the string - eg: email = Request.Form("email")

  • Creating an email - I generally use CDONTS

  • Formatting the Body of your email

    The code for creating your email could look something like:


    set mailobj = server.CreateObject("CDONTS.Newmail")
    mailobj.From = FromEmailAddress
    mailobj.To = ToEmailAddress
    mailobj.Subject = "Postcard from www.mysite.com"
    mailobj.Body = mailBody
    mailobj.Send
    set mailobj = nothing

    And a small example of how to format the body:


    mailBody = "Some Header Text" & vbCr & vbCr
    mailBody = mailBody & "HTML code for the email" &vbCr

    You can then pull in the relative image code, names, text etc. using variables assigned to the form values


    userComments = Request.Form("comments")

    The best advise I can give is to have a look at some online tutorials and also buy yourself and book!

    HTH

    BlobFisk

  • feemgh

    2:17 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    Excellent - thanks BlobFisk.

    One last thing - can you recommend any good books?

    Cheers

    feeeeeeee

    BlobFisk

    2:35 pm on Nov 7, 2002 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    There are literally thousands of books out there on ASP - O'Reilly, WROX, Sam's, the Mastering series, the Professional series.... Choosing one depends on your own personal preference.

    Mastering Active Server Pages by A Russell Jones is a good start - although if you like the Teach Yourself in 21 Days books (which I'm not particularly fond of) that would do the job too.

    Browse around your local bookshop and see which one appeals to you most in terms of teaching techniques, layout, language style etc.

    Good luck!

    BlobFisk

    feemgh

    3:43 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    Thanks again BlobFisk.

    excell

    4:02 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    We use our own customised version of "hamcards" it is very basic, but enough for a beginner to build their own needs around without getting too techy about it.

    feemgh

    5:25 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    Excell - Checked out "HamCards" on Hotscript but link was broken...not sure if still around as tried various other links in Google and all showing errors.

    Thanks anyway.

    feeeeee

    excell

    5:41 pm on Nov 7, 2002 (gmt 0)

    10+ Year Member



    oh well, :)
    sorry about that.. good luck in your search!
    Have you been here? It might have something, no idea if it does or not.

    cgiscriptsonline.com/search/Perl/Postcards/

    feemgh

    9:01 am on Nov 8, 2002 (gmt 0)

    10+ Year Member



    Thanks Excell - this link is similar to Hotscripts.

    The only thing is, I only want to send 1 postcard and I don't want adverts or to have to rely on a third party etc -

    I don't want much huh!

    Cheers

    feee