Sending textbox inputs to email HTML - html

I'm working on a page where I have 2 textboxes.
I want to send the user inputs for these 2 mailboxes to my email but my code doesn't seem to work. Is there anything I've missed?
<form method="post" action="mailto:youremail#youremail.com" >
First:<input type="text" name="First" size="12" maxlength="12" />
Last:<input type="text" name="Last" size="24" maxlength="24" />
<input type="submit" value="Send Email" />
</form>

Your code is correct, it does work for me. It probably doesn't work for you because you don't have an email client, or your browser turns off this feature for security (or something like that). I would recommend that you use a service to perform this action such as http://www.braveapps.com/emailfwd/ or http://allforms.mailjol.net/.

Related

How do you send the contents of a fieldset to an email address?

I have a fieldset:
<div class="form-container container">
<form id="contact-form" action="mailto:xyz#email.com" method="post">
<fieldset form="#contact-form">
<legend>Contact Form</legend>
<label class="input-field-name">Name:<br />
<input class="input-field" type="text" name="Name"/>
</label><br />
<label class="input-field-name">Email:<br />
<input class="input-field" type="text" name="Email"/>
</label><br />
<label class="input-field-name">Message Title:<br />
<input class="input-field" type="text" name="Message Title"/>
</label><br />
<label class="input-field-name">Message:<br />
<textarea class="message-field" type="text" name="Message"></textarea>
</label><br />
<button id="submit-button" type="submit">Submit</button>
</fieldset>
</form>
</div>
I want to set it up so that the person who wants to contact me can enter their details and then when the 'Submit' button is clicked I receive an email with the Message Title as the header and the persons Name, Email and Message in the body of the email.
At the moment the mailto:xyz#email.com section will open up an email client successfully but I want it to just send automatically. I have some understanding of js and php but this is the first time I've tried something like this so was looking to be pointed in the right direction. I'm not asking for all the code, just what I need to do then I can work it out for myself.
At the moment the mailto:xyz#email.com section will open up an email client successfully but I want it to just send automatically.
You can't, at least not client-side. The mailto: protocol handler is intended to simply launch the registered e-mail client for the user. Nothing more.
I have some understanding of js and php but this is the first time I've tried something like this so was hoping someone could point me in the right direction
You can send the e-mail server-side with PHP. Don't bother with mail(), which is just a utility function for basic debugging and such. Consider a robust e-mail class like PHPMailer. That way, you can use secured SMTP servers, and also send HTML e-mails with proper multipart MIME encoding.

HTML code to send SMS message through a form

I am trying to create an HTML code in order to send SMS messages through a form.
My provider give to me the Http address that i could send these SMS and it looks like bello (of course i have hide passwords, etc)
http://sms.services/send-sms?app-id=108744&password=1111111&to={1}&from=TestSender&message={0}
When i call this address with a phone number instead of {1} and a text insted of {0} it works fine.
But when i try to create the bellow page it says that the attributes are wrong.
Can you please help?
<form action="http://sms.services/send-sms?app-id=108744&password=1111111&to=telnumber&from=TestSender&message=textsms" method="post">
<input type="number" name="telnumber" />
<input type="text" name="textsms" />
<input type="submit" value="Submit" />
Change your method to GET
Make other parameters input type hidden so user will not see those but internally it will be passed.
<form action="http://sms.services/send-sms" method="get">
<input type="number" name="to" />
<input type="text" name="message" />
<input type="hidden" name="app-id" value="108744" />
<input type="hidden" name="password" value="1111111" />
<input type="hidden" name="from" value="TestSender" />
<input type="submit" value="Submit" />
</form>
Note: It is not recommended to do like it because it will expose your app-id and password. You should send it to a php or any backend framework and then from there call this.
Try to use input type="text" instead of number.
Probably, input type="number" tries to convert string to demical, but your provider use string

Understanding HTML form code

i am bit confused about the code..This is login.php file..and action of the form is also in the same file.Can this happen? if,then same login form should open if user submit the form...i am making my website,where i want to use login/register form.
<form action="login.php" method="post" class="f-wrap-1">
<div class="req">
Not Registered?<br />
Forgot your Password?
</div>
<fieldset>
<h3>Member Login</h3>
<label for="firstname"><b>Username:</b>
<input id="username" name="username" type="text" class="f-name" autocomplete="on" tabindex="1" /><br />
</label>
<label for="password"><b>Password:</b>
<input id="password" name="password" type="password" class="f-name" autocomplete="off" tabindex="2" /><br />
</label>
<label for="code"><b>Security Code:</b>
<input id="code" name="code" type="text" class="f-name" autocomplete="off" tabindex="3" /><br />
</label>
<label for="code2"><b> </b>
<img src="image.php?" /><br />
</label>
<div class="f-submit-wrap">
<input type="submit" value="Submit" class="f-submit" tabindex="4" /><br />
</div>
</fieldset>
</form>
This is login.php file..and action of the form is also in the same file.Can this happen?
Yes
if,then same login form should open if user submit the form
Not necessarily. In a system like this, the form data will be processed by server side code. The logic will probably be something like:
If it is a GET request, send the browser the form.
Otherwise, if it is a POST request, then check the form data:
If it is valid login data, then: set a cookie to track the user and
tell the browser to get some other URL.
Otherwise, the login data is wrong: populate the form with an error message
and possibly default the values of the fields to the wrong data the user
entered, then send the form to the browser.
Populating the form with the invalid data doesn't make much sense in a login form like this one, but it more useful in (for example) a registration form.
Who wants to retype all their personal data again just because the username they wanted is not available or they missed a field?
It's possible to send form to same file but it's not in good style. You would have to check if post data is available and display proper view based on that.
Better way to do it is just change the action of the form to point to another file and in that file handle login logic.
<form action="file.php" method="post" class="f-wrap-1">

Why does my input box not accept data on my website

I have a form to enable people to provide an email address but it wont allow any input. The site is www.pbadvisory.com.au and here is my HTML code:
<form action="mailto:jdoe#pbadvisory.com.au" method="get">
<input type="text" name="emailaddress" id="newsletter_email" />
<input type="submit" id="newsletter_subscribe" value="Subscribe" name="submit" />
</form>
any suggestions to fix would be appreciated
Just went through your site. Actually it is allowing to input the text. But the text color is white and background is white, so its invisible. Change the text color so you can see it.
You cannot use a mailto: as a form action. If you want a form that sends e-mail, it must be done server-side.
Try with following Changes!
<form action="MAILTO:jdoe#pbadvisory.com.au" method="post" enctype="text/plain">
<input type="text" name="emailaddress" id="newsletter_email" />
<input type="submit" id="newsletter_subscribe" value="Subscribe" name="submit" />
</form>
Form method should be 'post' not get. That's the reason for your problem. Any way here is the full code with email subject is also included.
<form method="post" action="mailto:youremail#youremail.com?Subject=Email Subject" enctype="text/plain">
E-mail:<input id="emailAddress" name="E-mail" type="text" maxlength="24" />
<input type="submit" value="Send Email" />
</form>
Hope it helped.
Update:
Just a note this is not the right way if you want users to get subscribe with your web site.

HTML Form in ie giving me the problem

<form method='POST' action="some action">
<span>
<input id="foo" type="password" value="Enter Password"/>
<input type="submit" class="go-btn" id="go-button" value="" />
</span>
</form>
This is the HTML form I am using. In IE when I hit the enter key It will open a small window to which says to download something. But When I click the submit button It works fine.
BTW every thing is working fine with Mozilla and Chrome.
Try giving a name to your password input:
<input id="foo" type="password" name="password" value="Enter Password" />
action="some action"
Is most likely your problem. Change this to the page that you want it to go to. (It's trying to send the data to the page "some action" which is causing it to break)