- This topic is empty.
-
AuthorPosts
-
April 26, 2011 at 11:05 pm #32503
jesb
ParticipantSo looking further into this, I’m new to webdesign, it looks like I need to know how to use scripts some what to use a form?
So I’m setting up my form which just needs to be set up to receive mail. I’ve tested it by sending myself an email to myself with a generic name, and an alternate email of my own in the form. I’m finding two issues. One when I hit submit, instead of the message just going straight to that email address of mine, it opens up a mail app to send the message. What is the proper way to do this so that I get the message to my email and the user not getting their mail app pop to send the email.
Here is my code I’m using.
That’s one issue, the 2nd is in my actual message I get this text.
Full+Name=jon+smith&Email=jonsmith%40gmail.com&x=46&y=18
April 27, 2011 at 9:30 am #49190sly
ParticipantHi,
You need to use a script and point to that script in the ‘action=”your-mail-script.php”.
Chris has a helpful article on this here: https://css-tricks.com/nice-and-simple-contact-form/
and also a screencast here: https://css-tricks.com/creating-a-unique-contact-for/
It all seems a bit complicated at first but it’s actually not, once you learn a few basics.
Good luck,
Sly.
April 27, 2011 at 3:12 pm #49012jesb
ParticipantWhat about me getting the in the message sent…
Full+Name=jon+smith&Email=jonsmith%40gmail.com&x=46&y=18
Is this related to not having no scripting done yet, or is this another issue?
April 27, 2011 at 4:49 pm #49016ChrisBull
MemberHTML can’t send an email. The code you’re using as the forms action ‘mailto:[email protected]’ is so that the person who clicks it ‘It’s usually the ‘href’ value of an ‘a tag’ can send an email to that address.
If you want to send an email to the address the user enter I advise you to send the form to a php file, so action=”sendMail.php”, alternatively you can leave the action blank and put the form into a php file, either way works well.In side the php file you will want to check if the form has been entered, so…
if(isset($_POST)) {
send the mail
}
The to actualy send the mail you would use the php mail() function.
Of the top of my head I think it is like this,
mail('who its to', 'the mail subject', 'the message', 'headers');
But again that’s just from memory, There are HUNDEREDS of tutorials out there, make sure you check php.net aswell.
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.