how to set up an automatic Email

Discussion in 'HTML & Website Design' started by dubs89, Nov 25, 2008.

  1. #1
    Hi,

    I want a script that when someone enters there Email address in a text-box and hits submit A email will automatically forward to their Email address. Is this possible?

    Thank you,
    Wesley
     
    dubs89, Nov 25, 2008 IP
  2. hafizahmedraza

    hafizahmedraza Active Member

    Messages:
    141
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    Yes it Possible
    You can search free form mailer or use this one. xinbox.com
    I also use it.
     
    hafizahmedraza, Nov 26, 2008 IP
  3. drew22299

    drew22299 Guest

    Messages:
    76
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What language do you want to code it in? PHP? ASP.net? There are lots of tutorials on the net, for example http://uk.php.net/mail

    If you want to use PHP you can use this code:

    form1.htm

    <form method='post' method='send_email.php'>
    Email Address: <input type='text' name='emailaddress' /><br />
    Subject: <input type='text' name='subject' /><br />
    Message: <input type='text' name='emailmessage' /><br />
    <input type='submit' value='Send Email' />
    </form>

    When the user clicks the button the details entered into the form will be processed by the send_email.php page.

    send_email.php

    //Get the values entered into the form
    $email = $_POST['emailaddress'];
    $emailmessage = $_POST['emailmessage'];
    $subject = $_POST['subject'];

    //Send the email
    mail($email, $subject, $emailmessage);

    Or if you just want the user to enter their email address and send an email just remove the subject and message fields in the form and type the text you want to use for the subject and message in the send_email.php page.

    Hope this helps!
     
    drew22299, Nov 26, 2008 IP