Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Extracting Details from a form to Email

    The site is Instant-LegalAdvice.co.uk/Conveyancing.php

    Currently the form is filled out by the customer and the details they enter are sent to them. I would also like to send them the quote.

    $name = $_REQUEST['name'];
    $email = $_REQUEST['email'];
    $tel = $_REQUEST['telephone'];

    $body .= "Hello" . $name . "<br/><br/>";

    It uses PHP Mailer

    It looks a bit like that, how would you suggest I output the quote too?

    Cheers

  • #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    what is the quote?

    ie a calculation from the form or an attachment or something?

    you could create a function for phpmailer

    PHP Code:
    //this line uses the function below to send the email
    EmailQuote($name$email$tel$quote);

    function 
    EmailQuote($name$email$tel$quote) {
            include (
    "class.phpmailer.php");
        
            
    $mail = new PHPMailer();
            
            
    $mail->IsSMTP();      // set mailer to use SMTP
            
    $mail->SMTPDebug 1;
            
    $mail->SMTPAuth true;     // turn on SMTP authentication
            
    $mail->SMTPSecure 'ssl'
            
    $mail->Host "smtp.gmail.com";  // specify main and backup server
            
    $mail->Port 465
            
            
    $mail->Username "****@gmail.com";  // SMTP username
            
    $mail->Password "****"// SMTP password

            
    $mail->From "****@gmail.com";
            
    $mail->FromName "Your Company";
            
    $mail->AddAddress($email);

            
    $mail->WordWrap 50;                                 // set word wrap to 50 characters
        //    $mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
        //    $mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
            
    $mail->IsHTML(true);                                  // set email format to HTML

            
    $mail->Subject "Quote from Your Company";
            
    $mail->Body    "<table width='400' border='0'>
      <tr>
        <td>Hello $name <br/><br/></td>
      </tr>
      <tr>
        <td><hr /></td>
      </tr>
      <tr>
        <td>Here is your quotation.</td>
      </tr>
      <tr>
        <td><hr /></td>
      </tr>
      <tr>
        <td>$quote </td>
      </tr>
    </table>"
    ;

            if(!
    $mail->Send()) {
               echo 
    "Mailer Error: " $mail->ErrorInfo;
               exit;
            }
        } 
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •