-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e628109
commit 3a25196
Showing
10 changed files
with
188 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
// Set the time zone to your desired time zone | ||
date_default_timezone_set('America/New_York'); | ||
|
||
// Set the desired time for the email to be sent in 24-hour format (e.g. "14:30") | ||
$send_time = '14:30'; | ||
|
||
// Get the current date and time | ||
$current_time = date('H:i'); | ||
|
||
// If the current time matches the desired send time, send the email | ||
if ($current_time == $send_time) { | ||
// Set the recipient email address | ||
$recipient_email = "[email protected]"; | ||
|
||
// Set the email subject | ||
$subject = "Email Subject"; | ||
|
||
// Set the email message | ||
$message = "Email Message"; | ||
|
||
// Set the email headers | ||
$headers = "From: [email protected]\r\n"; | ||
$headers .= "Reply-To: [email protected]\r\n"; | ||
$headers .= "Cc: [email protected]\r\n"; | ||
$headers .= "Bcc: [email protected]\r\n"; | ||
$headers .= "X-Mailer: PHP/" . phpversion(); | ||
|
||
// Send the email | ||
mail($recipient_email, $subject, $message, $headers); | ||
} | ||
?> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
import { Link, useNavigate } from "react-router-dom"; | ||
import Navbar from '../Homepage/Navbar'; | ||
import './emailreminder.css' | ||
import React, { useState } from "react"; | ||
import axios from "axios"; | ||
|
||
function EmailReminder() { | ||
const [recipientEmail, setRecipientEmail] = useState(""); | ||
const [emailSubject, setEmailSubject] = useState(""); | ||
const [emailMessage, setEmailMessage] = useState(""); | ||
const [dateTime, setDateTime] = useState(""); | ||
|
||
const handleSubmit = async (event) => { | ||
event.preventDefault(); | ||
|
||
const data = new FormData(); | ||
data.append("recipient_email", recipientEmail); | ||
data.append("email_subject", emailSubject); | ||
data.append("email_message", emailMessage); | ||
data.append("date_time", dateTime); | ||
|
||
try { | ||
const response = await axios.post("send_email.php", data, { | ||
headers: { "Content-Type": "multipart/form-data" }, | ||
}); | ||
|
||
console.log(response.data); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Navbar /> | ||
<form className="container" onSubmit={handleSubmit}> | ||
<label htmlFor="recipient_email">Recipient Email</label> | ||
<input | ||
type="email" | ||
id="recipient_email" | ||
name="recipient_email" | ||
value={recipientEmail} | ||
onChange={(event) => setRecipientEmail(event.target.value)} | ||
/> | ||
<br /> | ||
|
||
<label htmlFor="email_subject">Email Subject</label> | ||
<input | ||
type="text" | ||
id="email_subject" | ||
name="email_subject" | ||
value={emailSubject} | ||
onChange={(event) => setEmailSubject(event.target.value)} | ||
/> | ||
<br /> | ||
|
||
<label htmlFor="email_message">Email Message</label> | ||
<textarea | ||
id="email_message" | ||
name="email_message" | ||
value={emailMessage} | ||
onChange={(event) => setEmailMessage(event.target.value)} | ||
/> | ||
<br /> | ||
|
||
<label htmlFor="date_time">Date and Time to Send</label> | ||
<input | ||
type="datetime-local" | ||
id="date_time" | ||
name="date_time" | ||
value={dateTime} | ||
onChange={(event) => setDateTime(event.target.value)} | ||
/> | ||
<br /> | ||
|
||
<button type="submit">Send Email</button> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default EmailReminder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
} | ||
|
||
.title { | ||
font-size: 36px; | ||
font-weight: bold; | ||
margin-bottom: 24px; | ||
} | ||
|
||
.form-group { | ||
margin-bottom: 16px; | ||
} | ||
|
||
.form-label { | ||
display: block; | ||
font-size: 18px; | ||
font-weight: bold; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.form-input { | ||
padding: 8px; | ||
font-size: 16px; | ||
width: 100%; | ||
border: none; | ||
border-radius: 4px; | ||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.form-textarea { | ||
padding: 8px; | ||
font-size: 16px; | ||
width: 100%; | ||
height: 120px; | ||
border: none; | ||
border-radius: 4px; | ||
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.form-button { | ||
background-color: #007bff; | ||
color: white; | ||
padding: 8px 16px; | ||
font-size: 16px; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
.form-button:hover { | ||
background-color: #0069d9; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters