Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Mailto in forms

Options
  • 20-12-2006 2:06pm
    #1
    Closed Accounts Posts: 78 ✭✭


    Hi,

    I want to put a form on a webpage that will use the mailto option for submitting the results.

    However, I am not sure if what I want to do is possible :-

    I want the mailto, to send it to different people depending on the information the user selects in the form. i.e. if they choose option A, the mailto is sent to person A. if this choose option Bm the mailto is sent to person B etc.

    I'm not sure if this is clear, or possible!!!

    Anyone any ideas? The server I am using is crap - can't handle asp.

    Please help as I need to get this done by the end of today. Any help or advice is greatly appreciated.

    J


Comments

  • Registered Users Posts: 1,127 ✭✭✭smcelhinney


    What can your server support? What server is it?

    You can use either CGI or PHP to do this. Actually most web based programming languages have some form of SMTP send functionality.

    More info please :)

    Or google "form to email PHP OR CGI OR <whatever_language>"

    HTH.


  • Closed Accounts Posts: 78 ✭✭Jen199


    Thanks a million for getting back to me.
    The server supports PHP - about which I know little or nothing to be honest.
    I know HTML and ASP quite well!!!

    Basically, I want a user to fill out a form. In that form, they will select their department. I need it to automatically send an email to someone from that department when the form is submitted. Not sure if this is possible but any help or ideas would be greatly appreciated.

    Thanks again,

    Jen


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    MailTo isn't really supported much by browsers any more, you'd be much better off with either a PHP script (which you should be able to understand easily enough if you know ASP), or frontpage extensions if your server supports them.

    If you do want to use mailto, you should be able to use javascript in the onChange trigger for your select to set the action for the form to whatever email address you need.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Jen199 wrote:
    Thanks a million for getting back to me.
    The server supports PHP - about which I know little or nothing to be honest.
    I know HTML and ASP quite well!!!

    Basically, I want a user to fill out a form. In that form, they will select their department. I need it to automatically send an email to someone from that department when the form is submitted. Not sure if this is possible but any help or ideas would be greatly appreciated.

    Thanks again,

    Jen

    I have no PHP experience whatsosever, but I can't imagine it would be hard to implement a simple mail script.

    Found this on google pretty quickly:

    [PHP]<?php
    $recipient = 'user@example.com';
    $subject = $_POST;
    $from = stripslashes($_POST);
    $msg = "Message from: $from\n\n".stripslashes($_POST);
    mail($recipient, $subject, $msg);
    ?>[/PHP]

    [html]<form name="form1" method="post"
    action="<?php echo $_SERVER ?>">
    <table border="0" cellspacing="0" cellpadding="2">
    <tr>
    <td>Name:</td>
    <td><input type="text" name="Name"></td>
    </tr>
    <tr>
    <td>Subject</td>
    <td><input type="text" name="Subject"></td>
    </tr>
    <tr>
    <td>Message:</td>
    <td><textarea name="MsgBody"></textarea></td>
    </tr>
    <tr>
    <td> </td>
    <td><input type="submit" name="Submit"
    value="Submit"></td>
    </tr>
    </table>
    </form>[/html]

    Full details here.

    I don't know why exactly, but I really don't like when forms use the email client on my PC. Probably because I generally don't use my work email address for online stuff.


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    stevenmu wrote:
    MailTo isn't really supported much by browsers any more,

    o_O

    All browsers currently support mailTo command. You need to just have an email client set up on your machine. If your referring to the server sending the mails then it shouldn't matter to the client at all.


  • Advertisement
Advertisement