Ask Experts Questions for FREE Help !
Ask
    klmgb's Avatar
    klmgb Posts: 114, Reputation: 13
    Junior Member
     
    #1

    Jan 27, 2006, 09:42 PM
    Mail Form
    I have a mail form from my webhost. I have modified to an extent. The only thing I can't figure out is this -- I want to take out thr from line. I can take it out to where it doesn't show up but when I try to send an email I get an error that says check the senders address. I do not want the sender to have to input an address. Is this possible?

    This is what I used

    Thanks for the help

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta name="GENERATOR" content="IBM WebSphere Studio">
    <title>Keith</title>
    </head>
    <body>
    <p>Please Fill out the form below and press "Send Email" to
    submit:</p>
    <form action="/cgi-bin/readSend.cgi" method="post">
    <table border="0">
    <tbody>
    <tr>
    <td align="right" width="51">To:</td>
    <td>&nbsp;
    Keith
    <!-- CHANGE THE "VALUE" TAG BELOW TO EDIT OR ADD RECIPIENT --><input
    name="TO" value="my email address" type="hidden">
    </td>
    </tr>
    <tr>
    <td align="right" width="51">From:</td>
    <td><input size="67" name="FROM"
    type="text"></td>
    </tr>
    <tr>
    <td align="right" width="51">Subject:</td>
    <td><input size="67" name="SUBJECT"
    type="text"></td>
    </tr>
    <tr>
    <td colspan="2"><textarea rows="15"
    cols="80" name="BODY" wrap="virtual"></textarea></td>
    </tr>
    <tr>
    <td width="51"></td>
    <td align="right"><input name="submit"
    value="Send Email" type="submit"><input
    name="clear" value="Clear Fields" type="reset"></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Jan 28, 2006, 07:19 AM
    I don't believe its possible. E-mail has to have a senders address even if it's a spoofed one (which I do not advocate doing).

    Something you might consider is to create a default address on one of the free sites and then default the From address to that.
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #3

    Jan 31, 2006, 04:56 AM
    Change the from part from:
    Code:
    <input size="67" name="FROM" type="text">
    To either:
    Code:
    <input name="FROM" type="hidden" value="[email protected]" />
    That will completely hide the from text box. Or you could use...
    Code:
    <input size="67" name="FROM" type="text" value="[email protected]" readonly />
    That will just make the from field readonly so people can see it but not change it. You could then use some CSS to make it look like normal text.

    In the above code just make sure you change the value attribute to where you want the email to be set as being sent from.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Jan 31, 2006, 06:54 AM
    LT,

    I'm curious, in your code, I understand it will hide the FROM box on the form, but will that mean the recipient won't see a FROM?

    Scott<>
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #5

    Jan 31, 2006, 08:16 AM
    Scott,

    The user won't see a from field on the page they are using but there will be a from header on the email. The from field is there, it's just hidden (viewing the HTML source would show it to you). So the CGI script Klmgb is using will be able to find the from address still and use that when sending the email.

    When I read the question, I thought Klmgb wanted to have an email form that didn't give the user an option of specifying a from address. So for example, it could be a form where a web page user could send something to themselves (e.g. product details). All you would really want the user to have to enter is a to address and possibly a subject and a message to be appended to whatever they are requesting. A from field wouldn't be required on the page as it would always be the same - e.g. an email for the website they are visiting. Kind of the reverse of a "contact me" form where you wouldn't need a to field, just a from and message field.
    klmgb's Avatar
    klmgb Posts: 114, Reputation: 13
    Junior Member
     
    #6

    Jan 31, 2006, 08:22 AM
    Let me start by saying -- Remember I am verrryyy new at this.

    Lt - When I changed the code to read <input name="FROM" type="hidden" value="[email protected]" /> and uploaded to my server, when I call up the email from my website it still shows the from block. But I saved it to my computer and opened the form with IE, it doesn't show up. I can only assume that it has something to do with how my ISP handles this function, which I also assume is somehow imdedded in this code <form action="/cgi-bin/readSend.cgi" method="post">. That I probably can't get to with my limited knowledge.
    What I am attempting is to not show any email addresses. But I notice that after I send an email from the website a new message pops up that says "Thank You, an email has been sent to [email protected], which is not written in to my form.

    Thanks
    klmgb's Avatar
    klmgb Posts: 114, Reputation: 13
    Junior Member
     
    #7

    Jan 31, 2006, 08:24 AM
    BTW, this a very primitive family website
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #8

    Jan 31, 2006, 08:54 AM
    LT thanks. My assumption was that he just didn't want to have the user fill in a FROM and that the content of the form would tell him who was responding. Unless he's taking an anonymous survey. In any case, the idea (which I had and you showed how to do) of using a default address, whether hidden or not should be workable.
    LTheobald's Avatar
    LTheobald Posts: 1,051, Reputation: 127
    Ultra Member
     
    #9

    Jan 31, 2006, 10:16 AM
    Quote Originally Posted by klmgb
    Lt - When I changed the code to read <input name="FROM" type="hidden" value="[email protected]" /> and uploaded to my server, when I call up the email from my website it still shows the from block. But I saved it to my computer and opened the form with IE, it doesn't show up.
    I'm guessing this is probably because you were viewing the version of your page in your cache (temporary internet files). Try loading up the site and pressing CTRL+F5. This will do a complete refresh of the page and you should be able to see the change.

    As for the username appearing after the script has ran. That will be in the CGI script you are calling (the one specified in the <form action=""> bit). If you are feeling brave open the CGI file, search for the text "An email has been sent to", and delete it so that just the quotes are left. Alternatively post it here and we can tell you what to edit.

    Quick note though. There's a very basic way of sending the contents of forms in emails. If you just have a form like below:
    Code:
    <form action="mailto:[email protected]" method="post" enctype="text/plain">
        <!-- Text boxes etc. here -->
        <input type="submit" name="submit" />
    </form>
    This will create an email containing any responses and place it in your emails program outbox (e.g. Outlook Express) so that it's ready to send next time you check your email. The only problem with this is that it doesn't work for those that only use webmail (e.g. Hotmail) on their computer. Also it may not work in older browsers. But if you know your family will be using Internet Explorer and Outlook Express, it's a quick and simple solution.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Box 16 of form W-2 [ 7 Answers ]

Hi I had one doubt before I call for clarification about it to my HR. The problem is in my w2 form box 16 which should contain income earned from NY state but it shows my total income i.e. it also includes the income which I earned in the state of Texas. If I am not wrong Box 16 should only...

Which tax form?f1-opt-h1 [ 1 Answers ]

Hi, I am single and frm india.my status n US stay hv been: f1-5jan-31 dec 2004 f1-1st jan 2005-10 feb 2005 Opt-11 feb 2005-30 sept 2005 h1b visa-1 oct 2005 till date I hv a question about which tax form should I use for tax year 2005 and am I a resident or non-resident alien?also note...

Which tax form to use? [ 3 Answers ]

Hi, I was wondering if anyone could help with an unusual situation that I am in: I just got married 2 months ago to someone who had just acquired an ITIN. My spouse is from Mexico, and we live in Ohio. 1) Which tax form would I use, the 1040 or the 1040EZ? (I make little money, as I am a...

Which Tax Form [ 3 Answers ]

Hi, I got my H1 visa in Oct 2004. Last year I filed for 1040NREZ form. I got married this year in Feb. My wife joined me over here on a H4 visa. She got her admissions in university for Fall semester with assitantship. So he got her visa status changed to F1. So which tax form can I file. ...

Which Form? [ 3 Answers ]

Hi, I am confused as to which form to fill. My H1B started in Nov 2004 and bfore that I was on OPT. Also, I originally filed my returns for 2004 using the 1040EZ form, and then later realised that I might have had to use th 1040NR-EZ form. If I am right, how do I proceed. Do I use the 1040X...


View more questions Search