-
Notifications
You must be signed in to change notification settings - Fork 0
/
send_email.php
31 lines (27 loc) · 903 Bytes
/
send_email.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
28
29
30
31
<?php
if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['type']) && isset($_POST['message'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$type = $_POST['type'];
$message = $_POST['message'];
// Set up the email recipient and subject
$to = 'herambk812@gmail.com'; // Replace with your email address
$subject = 'New Email from Contact Form';
// Compose the email content
$email_content = "Name: $name\n";
$email_content .= "Email: $email\n";
$email_content .= "Type: $type\n";
$email_content .= "Message: $message\n";
// Set up the email headers
$headers = "From: $name <$email>";
// Send the email
// ini_set();
// ini_set('SMTP', 'localhost');
// ini_set('smtp_port', 25);
if (mail($to, $subject, $email_content, $headers)) {
echo 'success';
} else {
echo 'error';
}
}
?>