SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to get IE5 to send the contents of an HTML form by e-mail using Outlook. I know that the basic idea is to make the recipients' e-mail address the Action. I can make a blank message open addressed as required but I can't get the user's input to appear in the message body.
    Can anyone help?

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    action="mailto:you@asdf.com"

  3. #3
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A better alternative, however, would be to use a simple form mail script.
    In php, this is barely a few lines of code and is only slightly longer in PERL.

  4. #4
    ********* Scotland Saltire's Avatar
    Join Date
    Jan 2000
    Location
    Scotland
    Posts
    660
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by anti_alias
    In php, this is barely a few lines of code and is only slightly longer in PERL.
    Do you know of any good form processing scripts in PHP?

  5. #5
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this -
    <code>
    #!/usr/local/bin/perl
    print "Content-type: text/html\n\n";
    print "Your mail has been sent!";
    use CGI;
    $cgi= new CGI;
    $mailprog = '/usr/lib/sendmail';
    $recipient = 'youremail@yourdomain';
    $formName1 = $cgi -> param('formName1');
    $formName2 = $cgi -> param('formName2');
    $formName3 = $cgi -> param('formName3');
    $formName4 = $cgi -> param('formName4');


    open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
    print MAIL "Subject: myNewForm\n";
    print MAIL "Results of formName1: $formName1\n";
    print MAIL "Results of fromName2: $formName2\n";
    print MAIL "Results of formName3: $formName3\n";
    print MAIL "Results of formName4: $formName4\n";
    close (MAIL);
    </code>

    This program will work on Unix with the mail program in its default location. If it is not in the default location, you will need to alter the '$mailprog' line to the new location. Ask your administrator.

    I am assuming you know how to set-up forms. If not, please reply.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  6. #6
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all your replies. This is for an Intranet type situation which is why I was so specific about the products used. Our NT server has no scripting capabilities. Doesn't this preclude the use of Perl and php?
    I have read that Navigator and IE5 apply the 'Action="mailto:blah@blah.blah"'type form differently. In the version below a blank message to the right person opens up with the correct subject heading but the contents of the form don't make it. I probably should have been this specific first time around.
    <form name="form1" method="post" action="mailto:jim@thingy.com?subject=test" enctype="text/plain">
    <b>Name/b><input type="text" length="20" name="yourname">
    <p>
    <b>Address/b> <input type="text" length="30" name="address">
    <p>
    <input type="submit" value="submit">
    </form>

  7. #7
    Freelance Web Designer KeithMcL's Avatar
    Join Date
    Oct 1999
    Location
    Dublin, Ireland
    Posts
    1,125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way to force mails to be sent using Outlook Express on the intranet is to make sure all computers have Outlook set to be the default mail client. Otherwise the default mail client will be used when using the mailto: tag.

    You should still be able to use a formmail script on your intranet. Ask the person that setup the intranet to give you a hand setting it up.

  8. #8
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Keith,
    Thanks. I'm still waiting for a reply from IT. Everyone has Outlook, as in the Office family member, as their default mail client as opposed to Outlook Express - should this make any difference?

  9. #9
    SitePoint Zealot pony's Avatar
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks to everyone who tried to help but I've just been informed that this is an Outlook '97 bug. It simply won't let you alter the body of an e-mail in this way or even using the URL.
    Bah humbug! Everyone in the network is using Outlook '97 and no chance of it being changed soon.

  10. #10
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An interesting point i've found with these things is that, for some reason, on our Apache server running on UNIX, forms submitted using the standard mailto:address blah blah action seem to vanish and never reach their destination.

    I've tried using different enctypes on the form, eg. text/html multipart/form-data and it still has the same effect.

    I'm using a different system now, so it's not a huge problem anymore, but does anyone know why it didn't work? For future reference?

    Ady
    v-technologies - Freelance Goodness.


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
  •