HTML assistance with sending an email.

SquigglyMonkey
SquigglyMonkey used Ask the Experts™
on
I have a website on an internal domain. It's hosted on IIS and uses some javascript scripts and SKEL for for content generation, resizing, it works well as a responsive web page.
There is a form to send email, it is centered around using an external email provider. I have set it up so that it puts the requested data, (type of info requested, name, email, etc) and puts that where it belongs in the users own default email client. (generally Outlook). We have our own SMTP server.
My question is what is the simplest approach to get email sent using the form? The server is Windows server 2016, IIS. I have looked up stuff and see PHP, ASP it's kind of crazy how complicated it gets. Maybe I have not found the right tutorial.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
William FulksSystems Analyst & Webmaster

Commented:
The simplest thing is to have the form generate an email for you, but whoever uses it must have an email client setup on their PC. That way you aren't actually sending via some script but using the form to create your email, then having Outlook do the work.

Here's the basics on doing an email form - https://www.w3schools.com/Html/tryit.asp?filename=tryhtml_form_mail

If you want to process the email entirely with the form, then you are going to have to get some scripts in place, secure them, etc. It's a LOT more work.

Author

Commented:
Thanks for the response, but I already have that, I thought that was clear, sorry. The form puts the data in their default email client. I don't want that. I want a server side send from the form.
Jose Gabriel Ortega CastroTop Rated Freelancer on MS Technologies
Awarded 2018
Distinguished Expert 2018

Commented:
Well, it seems is not so clear,
I have more questions.

You have a form and you want to send that form along with the email? or the form is the email that you want to send?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
This is what is currently in the webpage, it places info in the users default email client, they press send to send the email. This works. I don't like it.
<!-- Contact -->
							<article id="Contact">
								<h2 class="major">Contact</h2>
								<pre lang="xml"><form action="../" enctype="text/plain">
Type of enquiry?
        <select id="SelectContactType" name="sendEmailTo" onchange="setAction"tabindex="3">
            <option value="mailto:services@email.com?subject=Services question&body=">Services</option>
            <option value="mailto:Technical@email.com?subject=Technical Question&body=">Technical</option>
            <option value="mailto:other@email.com?subject=Other Information&body=">Other information</option>
        </select>
Your Question...
        <textarea cols="10" rows="3" id="TextArea1" name="textarea" tabindex="4"
            style="overflow: visible; width: 507px;"></textarea>
<input
            type="button"
            value="Submit"
            onclick="location.href=this.form.sendEmailTo.options[sendEmailTo.selectedIndex].value + this.form.textarea.value"
            tabindex="5"/>
    </p>
    </form>

Open in new window


The "default" form looks like this. It does not work, the scant help files on it say to follow it as an outline, and use a commercial service to provide the send mail part. I cannot do that.
<!-- Contact -->
							<article id="contact">
								<h2 class="major">Contact</h2>
								<form method="post" action="form-to-email.php">
									<div class="field half first">
										<label for="name">Name</label>
										<input type="text" name="name" id="name" />
									</div>
									<div class="field half">
										<label for="email">Email</label>
										<input type="text" name="email" id="email" />
									</div>
									<div class="field">
										<label for="message">Message</label>
										<textarea name="message" id="message" rows="4"></textarea>
									</div>
									<ul class="actions">
										<li><input type="submit" value="Submit" class="special" /></li>
										<li><input type="reset" value="Reset" /></li>
									</ul>
								</form>
								</article>

Open in new window

Have you looked into SendGrid?

Author

Commented:
Thanks RG, that falls into commercial provider, not something i can use.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial