-1

In my webpage i just want to send the details to mail for the owner and user ,so for that reason i am using "mailto", but it is not at all working.The code i am using is given below,i also want to know whether the code i used is correct or not,if it is wrong suggest me the correct code.

       <form name=PPMiniCart action="mailto:info@domain.com" method="post" enctype="text/plain">
          <fieldset>
               <input type="hidden" name="business" value="info@domain.com" />
               <input type="hidden" name="cmd" value="_cart" />
               <input type="hidden" name="display" value="1" />
               <input type="hidden" name="return" value="http://www.minicartjs.com/?success" />
           <input type="hidden" name="cancel_return" value="http://www.minicartjs.com/?cancel" />
               <input type="image" name="submit" value="Click here to edit / cancel Items in your cart"  onClick="submitform()" class="button" style="margin-left: 800px;"/>

            </fieldset>
       </form>
San
  • 5
  • 1
  • 3
    Yeah - that's not how you use a `mailto:` - you use that in a link, not as a form action. You need a script to convert the data from the form into an email message. – Geoff Atkins Jul 01 '15 at 10:42
  • 1
    it will not send mail directly, just it will invoke email client from user system – user1844933 Jul 01 '15 at 10:44
  • ok Thanks, But i don't know how to write the script for this as i am new to javascript, can please suggest me the script – San Jul 01 '15 at 10:45
  • I suggest the usage of PHPmailer taking into consideration that you have minor knowledge in php. and for a more secure way i propose to use SMTP in order to submit your form. you can read more on this here : http://phpmailer.worxware.com/index.php?pg=examplebsmtp – Pierre Irani Jul 01 '15 at 10:45

1 Answers1

0

Remove submit onclick function...

 <form name=PPMiniCart action="mailto:info@domain.com" method="post" enctype="text/plain">
          <fieldset>
               <input type="hidden" name="business" value="info@domain.com" />
               <input type="hidden" name="cmd" value="_cart" />
               <input type="hidden" name="display" value="1" />
               <input type="hidden" name="return" value="http://www.minicartjs.com/?success" />
           <input type="hidden" name="cancel_return" value="http://www.minicartjs.com/?cancel" />




<input type="image" name="submit" value="Click here to edit / cancel Items in your cart"   class="button" style="margin-left: 800px;"/>


            </fieldset>
       </form>

Here the sample

<form action="MAILTO:someone@example.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name" value="your name"><br>
E-mail:<br>
<input type="text" name="mail" value="your email"><br>
Comment:<br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
Saravanan Arunagiri
  • 585
  • 1
  • 5
  • 27
  • Thanks, but for 'onclick' actually i'm using script file to call a function. Removing onclick event also it's not sending a mail, showing microsoft outlook error... My form code is inner linked with javascript, so i cant write directly input type="text" likewise code. Give me any other suggestion. – San Jul 01 '15 at 11:06
  • Oh. if you use a javascript means include mail:to function in same javascript. [click here to see mailto javascript function](http://stackoverflow.com/questions/10172499/mailto-using-javascript) – Saravanan Arunagiri Jul 01 '15 at 11:17
  • Can you please give me an alternate for mailto: it is showing as MS outlook error not sending mail to given ..info@domain.com. – San Jul 01 '15 at 11:30