The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> create a button in a website for a form Email(subject and body done already)
fregon
post Aug 4 2017, 11:45 PM
Post #1





Group: Members
Posts: 3
Joined: 4-August 17
Member No.: 26,471



Hi,

I don't know if this is possible but I am trying to create button for my website that when pressed would create an outlook email.
Just like when you click an email address on a website would do.

The difference is that I don't want a blank email.
This is basically what I want to see in the email.
----------------------
From: (the customers email address, automatically inserted because it is the customers outlook)
To: (my email address that is inserted automatically by html code)
Subject: Questions regarding item stock (inserted automatically by html code)

Body: (inserted automatically by html code)
Please fill in the following questions.
Name:
Phone number:
email address:
item product number:
item product name:
Your question:

Thank you.
----------------------

So basically the customer just needs t fill in the email and press send.
Our email address, email subject and email body is ready from the beginning.

Could someone tell me how to create such a button please.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
fregon
post Aug 5 2017, 03:39 AM
Post #2





Group: Members
Posts: 3
Joined: 4-August 17
Member No.: 26,471



Yes this is what I was looking for.
Thank you.
I didn't know about the mailto code.

I also found how to put messages into the body of the email by using this
&amp;body=The main text of the email is here" target="_top">Send Mail</a>

The thing is hat I want to make the body of the email to look like this:
Please fill in the following questions.
Name:
Phone number:
email address:
item product number:
item product name:
Your question:

But what I get looks like this:
Please fill in the following questions.Name:Phone number:email address:item product number:item product name:Your question:

Typing in <br> doesn't work since it just shows up into the email itself.

I knwo its a slim hope but is there a solution to this?





User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 5 2017, 04:47 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You can use three parameters in the query string with mailto: subject, body and cc. So what you want can, technically, be done. Note that spaces and linebreaks need to be URL encoded though.

CODE
mailto:you@example.com?subject=Questions%20regarding%20item%20stock&body=Please%20fill%20in%20the%20following%20questions.%0D%0A%0D%0AName:%0D%0APhone%20number:%0D%0Aemail%20address:%0D%0Aitem%20product%20number:%0D%0Aitem%20product%20name:%0D%0AYour%20question:



That doesn't mean it will work. There must be en email client installed and the browser must be configured to use it. mailto has always been unreliable because of this (and more) and is so even more today when many people use webmail exclusively. Neither will it work if the user uses a public computer or someone else's machine. Well, in the last case it maybe will work, but it won't be the intended email account that's used.

As CharlesEF said, use a script if it is of any importance to you.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 01:10 AM