-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_script.php
More file actions
29 lines (29 loc) · 833 Bytes
/
send_script.php
File metadata and controls
29 lines (29 loc) · 833 Bytes
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
<?php
if (isset($_POST['send_message_btn'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
// Content-Type helps email client to parse file as HTML
// therefore retaining styles
//$headers = "MIME-Version: 1.0" . "\r\n";
$headers = "From: prithvinshetty.aadi@gmail.com" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$message = "<html>
<head>
<title>New message from website contact form</title>
</head>
<body>
<h1>" . $subject . "</h1>
<p>".$msg."</p>
</body>
</html>";
//ini_set('SMTP','localhost');
//ini_set('smtp_port','25');
if (mail($email, $subject, $message, $headers)) {
echo "Email sent";
}else{
echo "Failed to send email. Please try again later";
}
}
?>