Other Languages - How to send email with static html page

Asked By maacdamia macadamia on 24-Mar-12 02:40 AM
i need to send email from my html page,is there any method to do it that you may have tried sucessfully

can you help.............................................
Abhinav Sejpal replied to maacdamia macadamia on 24-Mar-12 02:58 AM
Only HTTP(S) URIs are safe for use in form actions. You need a server side process to send email (even if it is an externally hosted, third party service). Attempts to do this purely client side are http://isolani.co.uk/articles/mailto.html.

else You can't do this with pure static HTML. You'll need to use some sort of server side scripting, via an embedded language like PHP/Python/Perl/Ruby/jsp/asp etc., or a CGI handoff to a custom executable.you cant actually, only way is to use some email client app in user computer to send email like outlook as simple as this :

<a href="mailto:mail@mailhost.com">message<a/>


kalpana aparnathi replied to maacdamia macadamia on 24-Mar-12 05:33 AM
hi,

The Basic form of HTML mailto

<a href="mailto:kalpana@aparnathi.com">Send me an email</a>

Read more:http:

www.webdevelopersnotes.com/tips/html/html_mailto_attribute_html_tips.php3

Regards,
Suchit shah replied to maacdamia macadamia on 24-Mar-12 06:13 AM

Without any backend stuff your only option is using a mailto in an href. This relies on the user sending the email themselves. You might be able to do something with javascript to populated the email .e.g

"mailto:"+emailTo+"&subject="+subjectText+"&body="+bodyText

dipa ahuja replied to maacdamia macadamia on 24-Mar-12 11:02 AM
Using javascript :

<script type="text/javascript">
  var recipient = 'user@server.com';
  subject = 'Hi';
  message = 'Write the body of your message here';
 
  location.href = 'http://mail.google.com/mail/?view=cm&fs=1' +
  '&to=' + recipient +
  '&su=' + subject +
  '&body=' + message +
  '&ui=1';
  var sendGmail = function (opts) {
  var str = 'http://mail.google.com/mail/?view=cm&fs=1' +
  '&to=' + opts.to +
  '&su=' + opts.subject +
  '&body=' + opts.message +
  '&ui=1';
  location.href = str;
  }
  </script>
http://www.eggheadcafe.com/community/javascript/3/10392790/how-to-send-an-e-mailfeedback-form-to-a-e-mail-add-using-jscript-.aspx  
Somesh Yadav replied to maacdamia macadamia on 26-Mar-12 05:30 AM

You can't send an email with just HTML (From the Front-End) unless you don't mind interacting with a third party service provider which can do the back-end process for you.

Otherwise, you need to use the Back-End, the most common and easiest way to do this is with PHP.