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.

PHP form email

Discussion in 'PHP' started by seosemguy, Jul 10, 2011.

  1. #1
    Hi! I have a form on my page, and when its filled i press button submit. But it uses Outlook to send. How can i make it send forms by email without using Outlook, just rigth from the page? Include the whole code.
     
    seosemguy, Jul 10, 2011 IP
  2. yusuyi

    yusuyi Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    using
    mail($to,$subject,$message1,$header);
    You could send mail via PHP
     
    yusuyi, Jul 10, 2011 IP
  3. akshat.gl

    akshat.gl Member

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    use mail function

    mail($to,$subject,$message,$headers);

    SAMPLE HEADERS
    $headers = "From: ".$sender_email.;

    Make sure your server supports SMTP. Don't worry 90% servers support it :)
     
    akshat.gl, Jul 11, 2011 IP
  4. Romeo12

    Romeo12 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi,

    I must asked some of you,is there any who have good IT books about PHP
     
    Romeo12, Jul 11, 2011 IP
  5. j_o

    j_o Well-Known Member

    Messages:
    516
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    113
    #5

    I dont know about books but there are tons of great online resources. For examplew3schools.com/php/ is great for the basics.

    Another is http://www.lynda.com

    I personally thought the video tutorials at Lynda were extremely helpful when I was first starting with php.
     
    j_o, Jul 11, 2011 IP
  6. AdsMakeSense

    AdsMakeSense Active Member

    Messages:
    389
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    70
    #6
    A More Formatted Example from:
    http://www.php.net/manual/en/function.mail.php

    <?php
    $to      = 'nobody@example.com';
    $subject = 'the subject';
    $message = 'hello';
    $headers = 'From: webmaster@example.com' . "\r\n" .
        'Reply-To: webmaster@example.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();
    
    mail($to, $subject, $message, $headers);
    ?> 
    Code (markup):
     
    AdsMakeSense, Jul 11, 2011 IP
  7. prasanthmj

    prasanthmj Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #7
    prasanthmj, Jul 11, 2011 IP
  8. omeslawanya

    omeslawanya Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    mail($to,$subject,$message1,$header);
    You could send mail via PHP
     
    omeslawanya, Jul 11, 2011 IP
  9. gnomee

    gnomee Greenhorn

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    If you need books to learning PHP visit BookDepository. They have really cheap books and free delivery for some countries.
     
    gnomee, Jul 12, 2011 IP
  10. US Vice

    US Vice Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Tut on this: jabrannawaz.me/tutorials/viewtutorial.php?id=8
     
    US Vice, Jul 16, 2011 IP
  11. gnomee

    gnomee Greenhorn

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #11
    Or try with PHPmailer..
     
    gnomee, Jul 16, 2011 IP
  12. oxyzenwebmedia

    oxyzenwebmedia Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    <?php
    $to = "somebody@example.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@example.com" . "\r\n" .
    "CC: somebodyelse@example.com";
    
    mail($to,$subject,$txt,$headers);
    ?>
    PHP:
     
    oxyzenwebmedia, Jul 16, 2011 IP