Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.57/5 (4 votes)
See more:
Hi,
I have one Contactus page and in that i give name,email and content then clcik submit button i want to send email.

How to send email in html page?

Thanks in advance.
santhosh
Posted
Comments
Anoop Kr Sharma 7-Oct-13 0:00am    
use action attribute of form.ex <form action="MAILTO:someone@example.com" method="post">
Anoop Kr Sharma 7-Oct-13 0:04am    
Check this link it may be helpful for you Sending mail using mailto in HTML
24983 7-Oct-13 0:27am    
Thanks for reply...
+i used this <form action="MAILTO:someone@example.com" method="post">
when i click button it will open outlook express but not send in email.
bbirajdar 7-Oct-13 0:58am    
I have posted the Solution 2 below. Its not in Hebrew but in english. Hope you understand it. And down voting it will not change how the web works
Anoop Kr Sharma 7-Oct-13 0:40am    
Sending an email from a web form requires a server side language to communicate with a mail server and send messages.
Do you Know PHP or ASP.NET.If yes then check these links PHP Example orASP.NET Example

Your question is like asking - "How can I reach the moon using a pedal led bicycle"...

And the answer is - You cannot.

Sending email requires SMTP server. It cannot be sent from the HTML alone. You need the access to the SMTP server which resides on server side. So you need to switch to dynamic website on platform like ASP.NET or PHP or any other.

HTML websites are static. They cannot be used to send email. At the most the user can open his default email editor by clicking on the mailto link in the HTML page.But cannot actually SEND mail from your website.
 
Share this answer
 
Comments
Anoop Kr Sharma 7-Oct-13 0:26am    
Totally Agree with your Solution.+5
bbirajdar 7-Oct-13 0:58am    
Thank you Anoop...
CyberSaint 27-Apr-17 2:13am    
yup can send requires php script html is not compatible well html only formats .. need script server side to send message
you can start it from here.

http://www.bing.com/search?q=Sending+Email+in+HTML&FORM=QSRE1[^]

visit above mentioned link you will find the solution.!!!
 
Share this answer
 
Comments
24983 7-Oct-13 7:48am    
hi ... I tried this in php and not working following programs
$to = "santhoshdevcare@yahoo.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

if (mail($to, $subject, $body,$headers )) {
echo("<p?-->Email successfully sent!</p>");
} else {
echo("<p>Email delivery failed…</p>");
}
[no name] 7-Oct-13 7:58am    
try this..
1. http://stackoverflow.com/questions/9750119/send-email-html-html5

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