Sending an Email Using R Markdown? - html

I have always wondered if this is possible in R.
On many websites, there is usually an interactive form which allows the user to send an e-mail to the owner of the website for feedback, comments, questions and suggestions:
Is it possible to create such a form within a Rmarkdown/Flexdashboard document?
I found links online that shows something similar :
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail
How to send email from HTML Form
For example - I copy and paste this code in the Rmarkdown document:
<html>
<body>
<h2> Questions? Send an e-mail! </h2>
<form action="mailto:antonoyaro_9999999999999#hotmail.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
I think this partially worked - but is there a better way to do this?
Thanks!

Related

HTML E-mail form

So my site is almost done but I'm stuck on the part of sending an email.
Everything works, when I fill in the fields. But it always gets saved as a draft so I don't receive the email.
Here is my html code:
This code is copied from a site.
<form action="mailto:myemailadress#gmail.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
action="mailto:myemailadress#gmail.com" <-- This is not correct.
You'll have to point your post submission to a handler php file that will process the form request and submit the email.
Now, some host providers do have a php mailer to make us things easier, e.g godaddy https://www.godaddy.com/es/help/using-our-php-form-mailers-on-web-and-classic-hosting-8376 .
An example of php mail handler for forms can be found here http://www.freecontactform.com/email_form.php . It has some validation code too.
There is a possibility that you're using a server that doesn't support PHP but ASP, .NET, Node.js or some other, in that case i can't help you because i'm not familiar to none of them :)

What is "mailto:someone#example.com" in following HTML form example?

I am learning HTML from w3schools HTML Tutorial - The Best in Class Tutorial
I come across one HTML form example which sends an email.
Please note that currently neither do I nor w3schools is going for server side input processing, so you also don't think about server side processing while considering my question.
Below is the code of HTML example :
<!DOCTYPE html>
<html>
<body>
<h2>Send e-mail to someone#example.com:</h2>
<form action="mailto:someone#example.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
Normally I see a .php or .asp filename in action attribute of a form but in above example it's mailto:someone#example.com.
I want to know what is it and why they have not used a .php or .asp file-name as they normally do?
Please someone explain me.
Thank You.
You are basically giving the users browser the job of handling the mailto request. The browser usually starts the users mail client and fills in the fields according to the input of your form.

How do I get my submit button to work?

I am no expert in coding. As a matter of a fact this is my first true project in CSS. I created the page in Adobe Edge Reflow and exported CSS to dreamweaver. The problem I am running into is that I can't get my form to actually work. I want the form to send directly to my e-mail, in no specific format. Can anyone help me out?
<form method="post" novalidate>
<label id="formgroup">
<p id="text1">
Name*
</p>
<input id="textinput" type="text" value=" Your Name"></input>
</label>
<label id="formgroup1">
<p id="text2">
Company Name
</p>
<input id="textinput1" type="text" value=" Company Name"></input>
</label>
<label id="formgroup2">
<p id="text3">
Email*
</p>
<input id="textinput2" type="text" value=" email"></input>
</label>
<label id="formgroup3">
<p id="text4">
Message*
</p>
<input id="textinput3" type="text" value=" Your message"></input>
</label>
<input id="submit" type="submit" value="Send Message"></input>
<input type="hidden" name="recipient" value="xxx#gmail.com"> </form>
Your HTML markup seems fine for a simple form aimed to post the contents of a range of fields.
However, the HTML code (along with any CSS) will only enable you to determine the presentation/style of the form (i.e. how it looks).
Regarding the functionality of the application actually triggering an email with the form contents to an email address, this will require more code in a 'server-side' language such as PHP (HTML and CSS being 'client-side' languages).
Here is a good article that provides a tutorial on the subject: http://www.html-form-guide.com/php-form/php-form-tutorial.html
Your HTML markup is actually missing something, the "action" property, i.e.
Before:
<form method="post" novalidate>
After:
<form method="post" novalidate action="send-email.php">
As you might have guessed from looking at the above, this "action" property specifies the PHP script/file that triggers the email. And of course it is this file that you are currently missing.
Hope this helps.

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 Forms: Display entered data on a separate page

I have a simple HTML form like this:
<form name='input' action='thankyou.jsp' method='post'>
<p>Email Address: <input type='text' name='email' size='16' /><br>
<p>Password: <input type='password' name='password' size='16' /><br>
<p>Verify Password: <input type='password' name='verifypassword' size='16' /><br>
<br>
<input type='submit' value='Submit your data'/>
</form>
I want to be able to take the information a user enters and display it on a thank you page afterwards, how could I go about doing so?
you can first study the server-side scripting language,if you want to read JavaScript than this link may help you.
visit this site Click Here.
you can also choose other scripting language which you understand easily.