-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailprocess.php
27 lines (25 loc) · 924 Bytes
/
mailprocess.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require_once "Mail.php";
$from = $_POST["email"];
$name = $_POST["name"];
$cno = $_POST["cno"];
$email = $_POST["email"];
$info = $_POST["info"];
$message = $_POST["message"];
$to = "[email protected]";
$subject = "Hi!";
$body = "Name: " + $name + " Contactno: " + $cno + " Email: " + $email + " How did you hear about us?: " + $info + " Message: " + $message;
$host = "smtp.gmail.com";
$port = "465";
$username = "[email protected]";
$password = "vodafone3g";
$headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
}
else {
echo("<p>Message successfully sent!</p>");
}
?>