Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Plz help me.

[edit]Note to the OP: the word "Me" contains two letters, not 102. Only one of these should be a vowel. Spelling words to sound like you are whining makes you appear to be a child - OriginalGriff[/edit]
Posted
Updated 21-Mar-11 1:15am
v2

Do it from the code behind: there is a generic method here: Sending an Email in C# with or without attachments: generic routine.[^]

Next time, (apart from learning to spell simple words) try to use Google first.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 21-Mar-11 7:52am    
That said, one cannot "send" e-mail from HTML. One can only post data needed to send e-mail. What the server does with the data is beyond HTML. A 5 for good reference.
--SA
Here is a form I use...

Adapt to your own needs.

XML
<form action="../" enctype="text/plain">
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
                    <input name="customername" size="60"
                        style="background-color: #FFFFCC; text-align: left;" type="text"
                        value="Name" tabindex="1"/>
                    <input name="customernumber" size="60"
                        style="background-color: #FFFFCC; text-align: left; width: 202px; margin-left: 42px;"
                        type="text" value="Tel No." tabindex="2" />
                    <input  visible="false" name="space" size="0" style="width:0px;" value="%0A" tabindex="0" />
                </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 12px; width: 655px;"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Type of enquiry?</p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
                    <select id="SelectContactType" name="sendEmailTo" onchange="setAction"
                        tabindex="3">
                        <option value="mailto:sales@ACompany.co.uk?subject=HomeQuery&body=">Sales</option>
                        <option value="mailto:colin@ACompany.co.uk?subject=HomeQuery&body=">Contractor</option>
                        <option value="mailto:pat@ACompany.co.uk?subject=HomeQuery&body=">Technical</option>
                        <option value="mailto:enquiries@ACompany.co.uk?subject=HomeQuery&body=">Other</option>
                    </select>
                </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Your Question...</p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 62px;">
                    <textarea cols="10" rows="3" id="TextArea1" name="textarea" tabindex="4"
                        style="overflow: visible; width: 507px;"></textarea>
                </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; height: 9px;"> </p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">Finally, Your Email Address...</p>
                <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
                    <input name="customeremailaddress" size="60"
                        style="background-color: #FFFFCC" type="text" tabindex="5" />
                    <input
                        type="button"
                        value="Submit"
                        onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value + this.form.customername.value + this.form.space.value + this.form.customernumber.value + this.form.space.value + this.form.textarea.value + this.form.space.value + this.form.customeremailaddress.value"
                        tabindex="5"/>
                </p>
                <p style="text-align:center">
                    Press the Submit Button and we will contact you shortly with details, prices
                    etc
                </p>
                </form>
 
Share this answer
 
You cannot send mail directly from HTML form. You can send the mail through default mail provider set up on the client machine(Ex.Outlook) like this,
<a href="mailto:name@xxx.com">name@xxx.com</a>

So, when you click the mail id it will directly open Outlook.

Or

You you can use .Net technology and use the below link.
http://www.developer.com/net/asp/article.php/3096831/Using-ASPNET-To-Send-Email.htm[^]
 
Share this answer
 
v2
Comments
fjdiewornncalwe 21-Mar-11 9:05am    
Almost right, Toniyo. The correct way is to say that it will send the mail through the default mail provider set up on the client machine.
Toniyo Jackson 21-Mar-11 9:08am    
Yes. You are right. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900