Home > Design - Imagery, Banners & Landers >

How to send data to my email address (5)


05-28-2016 04:46 AM #1 affiliatefrommichigan (Member)
How to send data to my email address

Hello everyone, I uploaded this template to my web server today.

diet.clickperformance.xyz/index.html

Can someone look at my code and tell me why my form does not send the data to my email address?

Also, after users click on the submit button, how can I redirect them to a thank you page?

I am just using the html editor in my CPanel. Should I use another html editor? I have Adobe GoLive installed on my computer.

Thank you for your help.


05-28-2016 08:00 AM #2 imphocused (Member)

That form looks to be an HTML only template, with no PHP to process the form. Instead of the data being sent back to the server for processing, it's coded to load the user's local mail client, requiring them to actually send you an email. This is what popped up for me when I clicked submit:

Click image for larger version. 

Name:	Screen Shot 2016-05-28 at 2.53.22 AM.png 
Views:	44 
Size:	31.3 KB 
ID:	11499

I can't imagine anyone seeing that pop up and then clicking send. Considering my default email client isn't even configured, you would never get that from me.

If you're looking at templates, look for one that uses PHP if you plan on having data emailed to you.


05-28-2016 08:57 AM #3 imphocused (Member)

Here is a quick form you can use to get started. In your index.html file, replace the form section (lines 24-30) with the content in form.html. Then put your email in the 'thankyou.php' file (line 21), upload the file to your site, and test.


05-28-2016 09:10 AM #4 ysekse (Member)

There is some learning curve if you do everything by hand, especially since you need backend server stuff, all you write in html is just the client.

If you sign up for some mailing list service they will provide you with code so you can literally just "plug it in" and only worry about the HTML.

Though if you absolutely must do it by hand: bind the html button to a js function, in that js function you can validate the mail, send it to server so you can store it, and redirect the user afterwards. If you do this look for libraries, for example for validation of mails you can use parsleyjs.org.

If you do it by hand you'll need to:
1. Submit mail from HTML client to your server
2. Store the mails @ your server
3. Have some structure up so you can do mass mailing from server without too much trouble
4. Set up other technical stuff related to sending mails you didn't even know existed

imho best thing is to avoid this headache and use a service for the mailing

To redirect someone just use js. ex:

<div onclick="redirect()"></div>

<script>
function redirect() {
// do stuff, validate form, submit email etc
window.location.href="redirect url";
}
</script>


05-28-2016 01:36 PM #5 affiliatefrommichigan (Member)

Thank you so much guys for all the information..

What email services do you recommend?


Home > Design - Imagery, Banners & Landers >