1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to send data from forms to email

Discussion in 'C#' started by jhantraz, Jan 3, 2006.

  1. #1
    hello. just a newbie here, also in ASP and PHP.
    i just wanna ask how to send the data gathered from forms to emails?
    i know that this could be done in php. but i dont know how to do it either.
     
    jhantraz, Jan 3, 2006 IP
  2. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What processor is being used (Jmail, CDOSYS, ASPEMail, ASPMail, OCX, etc)?
     
    Corey Bryant, Jan 3, 2006 IP
  3. livingearth

    livingearth Well-Known Member

    Messages:
    1,469
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    140
    #3
    I think I have a solution for you....
    I am sending you a couple of files via PM
     
    livingearth, Jan 3, 2006 IP
  4. AStaupe

    AStaupe Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Here is a php script that will send any form information to an e-mail address I find it pretty handy.

    if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
    $message = "";
    while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
    $message = stripslashes($message);
    $to = "yourmail@yourdomain.com";
    $subject = "Your Subject";
    if (mail($to, $subject, $message))
    
    {
       echo("<h1>Thank You</h1>");
    
    }
    Code (markup):
     
    AStaupe, Jan 3, 2006 IP
  5. livingearth

    livingearth Well-Known Member

    Messages:
    1,469
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    140
    #5
    livingearth, Jan 3, 2006 IP
  6. toughguy

    toughguy Well-Known Member

    Messages:
    846
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    118
    #6
    Thank you AStaupe & livingearth for the info..
     
    toughguy, Jan 4, 2006 IP
  7. jhantraz

    jhantraz Banned

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks a lot for the kind hearted responses :D

    btw, corey, what about the processor? im just a newbie on asp programming:D can you please explain the processor thing? Thanks :)
     
    jhantraz, Jan 4, 2006 IP
  8. aGig

    aGig Well-Known Member

    Messages:
    428
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    118
    #8
    Your host will support different types of DLLs that send email. Windows NT - 2000 support CDONTS by default, Windows 2000 and 2003 support CDOSYS by default. Many providers support CDONTS on 2003 as well as other objects such as ASPEmail, Jmail and others. Some people don't like CDOSYS because they think MS reads the emails that are sent using it, I like Jmail my self.

    Mark
     
    aGig, Jan 5, 2006 IP
  9. gramos

    gramos Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks....but have another question...

    How do we email multiple fields using PHP?
    For example, in here mail($to, $subject, $message), you are only allowed one variable: $message. What if your form contains, say, 4 variables that need to be emailed.
     
    gramos, Feb 20, 2006 IP
  10. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #10
    Here is a simple code Hope it will help You.

    Pleas let me know if it's OK
     
    YIAM, Feb 20, 2006 IP
  11. gramos

    gramos Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I see, so you assign the needed variables to $message. Where did you derive .$var1. from? In other words, how do I pass the variables from the original form (POST) to the $message variable?

    Thanks for the help! :)

    Tinkered and figured it out...though, I need to find out how .$variable. work! In due time, in due time...thanks again! :)
     
    gramos, Feb 20, 2006 IP