How to generate email in PHP?

Discussion in 'PHP' started by iqocik, May 21, 2011.

  1. #1
    How to generate email in PHP in contact us form
     
    iqocik, May 21, 2011 IP
  2. Zetiz

    Zetiz Active Member

    Messages:
    668
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Use PHP mail() function to send any email.
     
    Zetiz, May 21, 2011 IP
  3. niks00789

    niks00789 Well-Known Member

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #3
    niks00789, May 21, 2011 IP
  4. UncleP

    UncleP Well-Known Member

    Messages:
    139
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    135
    #4
    I like the easy way myself and I've found the easiest way yet and for free too, my favorite price. It's open source so you can use it anywhere as well. The setup is a doddle, just go to: http://phpfmg.sourceforge.net and make one, then copy 'n paste the code or iframe it into a page. I've used it on both my sig sites.
     
    UncleP, May 21, 2011 IP
  5. runbrun11

    runbrun11 Member

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #5
    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    Code (markup):
     
    runbrun11, May 22, 2011 IP
  6. sautaja

    sautaja Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can also use swiftmail
     
    sautaja, May 26, 2011 IP
  7. adkarfaserv

    adkarfaserv Active Member

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #7
    it is very simple you can use the mail function for it...
     
    adkarfaserv, May 26, 2011 IP