Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once "Mail.php";
- require_once "Mail/mime.php";
- $yourname = $_POST['fname'];
- $coemail=$_POST['coemail'];
- $connum = $_POST['connum'];
- $conaddre=$_POST['conaddre'];
- $coamount = $_POST['coamount'];
- $coreturns=$_POST['coreturns'];
- $cotenure = $_POST['cotenure'];
- $cobudget=$_POST['cobudget'];
- $subject = "Email From Investors rnrn";
- $text = "This is a mail from Investors";
- $html = "<html><body><p>" "So Please find the below details!!!
- </p></body></html>";
- $crlf = "n";
- // create a new Mail_Mime for use
- $mime = new Mail_mime($crlf);
- // define body for Text only receipt
- $mime->setTXTBody($text);
- // define body for HTML capable recipients
- $mime->setHTMLBody($html);
- $from = $_POST['coemail'];
- $to = "Info <info@goldeneraproperty.com>";
- //$body .= 'Name: '.$yourname.'rnrn';
- //$body .= 'Contact Number: '.$connum.'rnrn';
- //$body .= 'Address: '.$conaddre.'rnrn';
- //$body .= 'Email ID: '.$coemail.'rnrn';
- //$body .= 'Amount: '.$coamount.'rnrn';
- //$body .= 'Expected Returns: '.$coreturns.'rnrn';
- //$body .= 'Expected Tenure: '.$cotenure.'rnrn';
- //$body .= 'Approximate Budget: '.$cobudget.'rnrn';
- $host = "mail.example.com";
- $username = "info@example.com";
- $password = "indfgh";
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $body = $mime->get();
- $headers = $mime->headers($headers);
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail))
- {
- //echo("<p>" . $mail->getMessage() . "</p>");
- echo 2;
- }
- else
- {
- //echo("<p>Message successfully sent!</p>");
- echo 1;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement