Advertisement
Guest User

Untitled

a guest
Aug 4th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <?php
  2. require_once "Mail.php";
  3.  
  4. require_once "Mail/mime.php";
  5.  
  6.  
  7. $yourname = $_POST['fname'];
  8.  
  9. $coemail=$_POST['coemail'];
  10.  
  11. $connum = $_POST['connum'];
  12.  
  13. $conaddre=$_POST['conaddre'];
  14.  
  15.  
  16. $coamount = $_POST['coamount'];
  17.  
  18. $coreturns=$_POST['coreturns'];
  19.  
  20. $cotenure = $_POST['cotenure'];
  21.  
  22. $cobudget=$_POST['cobudget'];
  23.  
  24. $subject = "Email From Investors rnrn";
  25. $text = "This is a mail from Investors";
  26. $html = "<html><body><p>" "So Please find the below details!!!
  27.  
  28.  
  29. </p></body></html>";
  30. $crlf = "n";
  31.  
  32. // create a new Mail_Mime for use
  33. $mime = new Mail_mime($crlf);
  34. // define body for Text only receipt
  35. $mime->setTXTBody($text);
  36. // define body for HTML capable recipients
  37. $mime->setHTMLBody($html);
  38.  
  39.  
  40.  
  41. $from = $_POST['coemail'];
  42. $to = "Info <info@goldeneraproperty.com>";
  43.  
  44.  
  45.  
  46.  
  47.  
  48. //$body .= 'Name: '.$yourname.'rnrn';
  49. //$body .= 'Contact Number: '.$connum.'rnrn';
  50. //$body .= 'Address: '.$conaddre.'rnrn';
  51. //$body .= 'Email ID: '.$coemail.'rnrn';
  52. //$body .= 'Amount: '.$coamount.'rnrn';
  53. //$body .= 'Expected Returns: '.$coreturns.'rnrn';
  54. //$body .= 'Expected Tenure: '.$cotenure.'rnrn';
  55. //$body .= 'Approximate Budget: '.$cobudget.'rnrn';
  56.  
  57.  
  58. $host = "mail.example.com";
  59. $username = "info@example.com";
  60. $password = "indfgh";
  61. $headers = array ('From' => $from,
  62. 'To' => $to,
  63. 'Subject' => $subject);
  64. $smtp = Mail::factory('smtp',
  65. array ('host' => $host,
  66. 'auth' => true,
  67. 'username' => $username,
  68. 'password' => $password));
  69.  
  70.  
  71. $body = $mime->get();
  72. $headers = $mime->headers($headers);
  73.  
  74. $mail = $smtp->send($to, $headers, $body);
  75. if (PEAR::isError($mail))
  76. {
  77. //echo("<p>" . $mail->getMessage() . "</p>");
  78. echo 2;
  79. }
  80. else
  81. {
  82. //echo("<p>Message successfully sent!</p>");
  83. echo 1;
  84. }
  85. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement