Sending mail using Javax mail and HTML Form - html

I have an HTML form where I have 2 fields "Email Subject" and "Email Content". If someone enters content like :
"Dear Sir,
Welcome to Java World."
On form submission, a handler is called and I am saving content using getParameter("emailContent") into a String variable. My question is, if I want to share mail-in exact same way as the user typed in form input, how can I achieve that? as HTML eliminates spaces.

Related

Reference a custom field in NS on the standard HTML transaction form/SO email form

Does anyone know how to reference a NS field in the standard HTML form?
I have a custom field on my SO that links to our external website. The field uses a formula to pull the NS SO internal ID to create the link so we can send it out to the customer. That field works perfect and I was able to get that link to display properly as an element on the standard PDF form layout that gets emailed to the customer as an attachment on the SO notification email.
Now, here is the issue, I don't know how to reference it on the "a href" html tag in the HTML code on the transaction HTML layout. I know the field name/backend ID, I just don't know how to reference it in the "a href" html tag, this is what I have so far:
Securely View, Edit, & Track the status of this order
(in the curly brackets is my field name and I removed the carrots so the exact code would show up in this text box)
Does anyone know how to get that field from the SO form to show up in the Transaction HTML Layout form?
Actually I figured it out. I needed to have the href set as <NLCUSTBODYPG_LINK_SO>.

How to perform email validation with Google Forms pre-submit

I am autogenerating some Google Forms which have the automatic email collection field enabled. I would like to make it so that each of them can only be submitted by certain emails. As such, I would like to check that the auto-collected email is an allowed email address before they submit the Form.
I would prefer not to use a regular textbox that says "enter email here", because then any user who opens the form could input an email which may not be their own.
I know I can check the email is correct after the Form is submitted, but I would prefer to do it before.
Is this possible?
Currently, it seems there is no way to validate automatically collected email before form submission.

How to redirect to an HTML classic asp page from Lotus notes form

There is a requirement in our application to add a Button in our lotus notes Form.
And on click of this button, the user will be redirected to a HTML or Classic ASP page.
We also want to pass the value of a textbox present in the same form, to the HTML /asp page.
I am new to Lotus notes scripting. Though with the help of internet, I am able to create a button in the form. But I dont find any solution to redirect the user to the required HTML /asp page.
Your help will be highly appreciated!!!
Assume there's a text field with name myfield in your form.
In your form add a button, then set #-formula for this button:
#URLOpen("http://www.yourserver.com/yourpage.asp?" + #URLEncode("UTF-8"; myfield));
when you click this button it will open asp page and will pass contents of myfield in urlencoded form (using UTF-8 encoding) to this page.

Sending JSP form POST information to email

This is probably a simple question but I'm having difficulty finding the solution online. I have created a simple HTML form within a JSP ('Enter name' text box and a submit button). I'm trying to find out if there is a way to send the POST information to a set email address. I don't want the user to have to pick a email to send it to which I know can be done with servlets. Rather than having the Name display when I click the submit button, I want the name to be sent to a email address that has been set on the backend. Could someone please link me to a tutorial where this can be done?
See how to send email: http://java2s.com/Code/Java/Email/Createaverysimpletextplainmessageandsendsit.htm. Text message shall contain values of form parameters - request.getParameter()

HTML (using CSS) Code for sending an email to given email-id

How can i code a HTML (using CSS) file to send an email to me(i.e. to given email-id) by the visitor of that website?
Without using a server-side language, the best you can really do is a mailto link. That will open the user's default email editor with the "To" field populated with the value of your mailto link. You can create one of those like so:
Email Me!
It is possible to provide extra information in a mailto link, to populate more fields. For example, if you want to provide a subject:
Email Me!
You can also provide a value for the body, cc and bcc but I have no idea how well those default values are supported by various email clients.
Also note that this has absolutely nothing whatsoever to do with CSS, which is used for styling documents. I've therefore removed the CSS tag from your question.
You cannot. You can use a tag:
Email Me
And this will open a mail client in the client side. The client must have it configured for being able to send a email.
If you want to create a form that, when the user presses a button "send" sends you a message, you must use a dynamic language such as PHP.