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 add email function in PHP in Order form

Discussion in 'PHP' started by Sheraz Khan Baloch, Oct 26, 2013.

  1. #1
    Hi,
    I have created an order form on the link below
    When a person fills up the form, and goes o the payment, I want that all info which he entered, must be emailed to us. But I dont know how to do this. The PHP files of all the 4 forms are attached.
    I want to add email function in that way that on Preview page, when a user submit the information and directed to payment processor, its info should be sent to our desired email ID. Can anyone help?

    Attached Files:

    Solved! View solution.
    Last edited: Jan 28, 2014
    Sheraz Khan Baloch, Oct 26, 2013 IP
  2. #2
    Check out this code from w3shools so you can see how simple it is actually.

    PHP:
    1. <?php
    2. $to = "someone@example.com";
    3. $subject = "Test mail";
    4. $message = "Hello! This is a simple email message.";
    5. $from = "someonelse@example.com";
    6. $headers = "From:" . $from;
    7. mail($to,$subject,$message,$headers);
    8. echo "Mail Sent.";
    9. ?>
    http://www.w3schools.com/php/php_mail.asp
    jscg, Oct 27, 2013 IP
  3. seotraining

    seotraining Active Member

    Messages:
    492
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    If you are using php then you can uise simple mail function if you want to send text mail but you should check with your server hwo many mails you can send. For sending mail wiht an attachment either you have to use library or you should have a class to send with an attachment if you dont know how to make customized one in php
    seotraining, Oct 27, 2013 IP
    Crock likes this.
  4. ezprint2008

    ezprint2008 Active Member

    Messages:
    595
    Likes Received:
    14
    Best Answers:
    2
    Trophy Points:
    90
    Digital Goods:
    4
    #4
    You'll be sending details in your email about the user so you need to set up your $message part of that email
    example:
    $message = $firstname . " " . $lastname . "\r\n" .
    "Address line1 " . " " . $address _line1 . "\r\n" .
    (etc.. all the addy info then the product info)
    "Product: " . " " . $product . "\r\n" ;

    then when $message is called, all of that information will be in the body /message of the email.
    dont send credit cards that way...unless you are encrypting. GNuPg (or a server side secure system)
    ezprint2008, Oct 30, 2013 IP