Email Subscribe Form Code help please!

5 replies
My developers have this code on my site which shows a form for name and email address then submit. They are slow to respond so thought I would post here.

Can you help me get this form to submit the data to me? I need it to just email me with the information to a particular email I have set up for this.

Here is the current code:

Code:
<div class="newsletter-bg">
<h2>Signup for our&nbsp;<span>newsletter!</span></h2><br />
<div class="nme-txtbox">
<div class="nme01">Name</div>
<div class="txtboxbg01"><input type="text" name="textfield" class="txtbox01" /></div></div>
<div class="nme-txtbox">
<div class="nme01">Email</div>
<div class="txtboxbg01"><input type="text" name="textfield" class="txtbox01" /></div></div>
<div class="nme-txtbox">
<div class="nme01">&nbsp;</div>
<div class="txtboxbg01"><a href="#"><img src="images/subscribe.gif" alt="" width="77" height="22" border="0" /></a></div></div></div></div></div></div></div>
#code #email #form #subscribe
  • Profile picture of the author Clint Butler
    The whole code is not there, there is no target showing where the information is going once submitted.

    Regards,
    Clint
    Signature
    {{ DiscussionBoard.errors[4836292].message }}
  • Profile picture of the author DianaHeuser
    Julie,
    Reading the code it appears that you are trying to get people to sign up for a newsletter? If this is so, why do you want to send an email to yourself? Will you be setting up a manual database with all their information?

    Why don't you try one of the autoresponder/newsletter free applications that are available.

    Once you have signed up, you can get the html coding from them and post it on your website. They manage your list for you and you can set it up to automatically get an email when someone signs up. Sending out a newsletter or email is a very easy process as well.

    Di
    {{ DiscussionBoard.errors[4836339].message }}
  • Profile picture of the author Clint Butler
    I was thinking the same thing Diana but then I remembered I did the same thing when I didn't have the money or the knowledge of how to effectively use one. So setting up a newsletter with a dedicated email account is a viable solution if you have a small list.

    Regards,
    Clint Butler
    Signature
    {{ DiscussionBoard.errors[4836349].message }}
  • Profile picture of the author WillR
    You are missing code. If this is an actual form there should be a form opening and closing tag <form> </form> and all the form code should be in between those tags.
    {{ DiscussionBoard.errors[4836382].message }}
  • Profile picture of the author sf_Imtiaz
    As others have mentioned the complete form code is not there. However, here's a simple example, the form code should look something like this.

    HTML Code:
    <form method="post" action="sendmail.php">
    Name: <input name="name" type="text"><br />
    Email: <input name="email" type="text"><br />
    <input type="submit">
    </form>
    Save the code below in a new file named "sendmail.php" and make sure you change the strings where necessary, such as your email, email subject etc.

    <?php
    $to = "you@your-website.com";
    $subject = "Subject Line Here";
    $name = $_POST['name'] ;
    $email = $_POST['email'] ;
    $headers = "From: $email";
    $message = "Name:$name - Email:$email";
    $sent = mail($to, $subject, $message, $headers) ;
    if($sent)
    {echo "Thank you for subscribing"; }
    else
    {echo "We are unable to process your request at this time, please try again later."; }
    ?>

    For some reasons the code above doesn't show when I wrap it in CODE or PHP tags
    {{ DiscussionBoard.errors[4836668].message }}

Trending Topics