Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other An issue I’m having with setting up my form so that I receive mail.

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32503
    jesb
    Participant

    So 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

    #49190
    sly
    Participant

    Hi,

    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.

    #49012
    jesb
    Participant

    What 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?

    #49016
    ChrisBull
    Member

    HTML 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.