Click here to Skip to main content
15,895,864 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello sir give me code
hoe to send email from html
my field
name--
message--

[UPDATE]
Hello sir not use outlook without outlook
use send mail or use following if you don't want to open outlook
Posted
Updated 24-Feb-11 20:07pm
v2
Comments
Sergey Alexandrovich Kryukov 25-Feb-11 1:30am    
I don't think anyone is interested to write code for you. You can find some code in Internet.
It looks like you have to do it yourself and ask questions if you face problems.
--SA
Sergey Alexandrovich Kryukov 25-Feb-11 2:09am    
I deleted your next Question and updated this one. You should not post similar Questions.
Use "Improve Question" instead.
--SA
Sergey Alexandrovich Kryukov 25-Feb-11 2:11am    
About clarification of your Question: from the very beginning I answered assuming using the launch of Outlook (or default e-mail agent) would not be the Answer, please see.
You will not get an Answer on how to "send e-mail" via HTTP; it is not possible.
--SA

use
<a href="mailto:email?subject=sub&body=msg">send mail </a>
or use following if you don't want to open outlook


<html>
 <head>
  <title> New Document </title>
 
 </head>

<html>
<body>
<form action="MAILTO:pankajupadhyay29@gmail.com" method="post" enctype="text/plain">

<h3>This form sends an e-mail to pankajupadhyay29@gmail.com.</h3>
Name:<br>
<input type="text" name="name">
value="Name size="20">
<br>
Mail:<br>
<input type="text" name="mail">
value="Mail id"  size="20">
<br>
Comment:<br>
<textarea>
</textarea>
</br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">

</input></input></br></br></input></br></br></input></br></form>
</body>
</html>
</html>


this code is taken from here[^]
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 25-Feb-11 1:38am    
This HTML does not really send e-mail.
--SA
pankajupadhyay29 25-Feb-11 1:41am    
yes actually outlook sends this mail automatically.
Sergey Alexandrovich Kryukov 25-Feb-11 1:45am    
How do you know the client computer has Outlook and the user has e-mail account? :-)
This is how your own system is tuned, including registered application and shell.
No, it does not send e-mail.
pankajupadhyay29 25-Feb-11 1:50am    
simple answer for that is we cannot send mail from HTML, we need to use some program for that and we never can ensure for that.
In that case we should use server side code.
Sergey Alexandrovich Kryukov 25-Feb-11 2:12am    
That is correct, but I put it in my Answer first, no need to repeat.
Thank you for understanding.
--SA
This ASP.NET Common Web Page Class Library - Part 3[^] may help to implement SAKryukovs suggestion.

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Feb-11 16:38pm    
Good reference, my 5
--SA
Espen Harlinn 25-Feb-11 17:40pm    
I thought it was appropriate, thanks SAKryukov!
By the way, you cannot "send e-mail" from HTML.

With HTML, what you can do it to create a form used to post request to your HTTP server via POST command. It's up to your server to process this post in any way such as sending e-mail. You don't have to write HTTP server for this purpose :) — there are different server-side modules which allows you to write a server-side script: APS.NET, Python via WSGI, Java Server Pages, PHP…

On HTML side, the key is using right attribute on the form:

HTML
<form action="My-Email-sender-URL" method="post" ...>
...
</form>


Security warning! Using posts like that for sending e-mail on the server side is an easy target for malicious attack which can turn you HTTP server into the spam-sending ghost as the post can be done programmatically. You should not use any posted data directly, especially for e-mail headers. You need to detect and filter out unexpected data. (I had to fix such security holes and faced such attacks in real life.)

—SA
 
Share this answer
 
v4
Comments
Espen Harlinn 25-Feb-11 6:42am    
Good idea, my 5
Sergey Alexandrovich Kryukov 25-Feb-11 16:38pm    
Thank you.
--SA

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