diff --git a/components/ComposeEmail.tsx b/components/ComposeEmail.tsx
index 6cdeaf2a..f3280bd7 100644
--- a/components/ComposeEmail.tsx
+++ b/components/ComposeEmail.tsx
@@ -83,26 +83,45 @@ export default function ComposeEmail({
useEffect(() => {
if (composeBodyRef.current && !isInitialized) {
- // Initialize the content structure with both new reply area and original content in a single contentEditable div
- const content = replyTo || forwardFrom ? `
-
- ${forwardFrom ? `
- ---------- Forwarded message ---------
- From: ${forwardFrom.from}
- Date: ${new Date(forwardFrom.date).toLocaleString()}
- Subject: ${forwardFrom.subject}
- To: ${forwardFrom.to}
- ${forwardFrom.cc ? `Cc: ${forwardFrom.cc}
` : ''}
-
- ` : `
- On ${new Date(replyTo?.date || '').toLocaleString()}, ${replyTo?.from} wrote:
- `}
-
- ${composeBody}
-
-
- ` : '';
+ let content = '';
+
+ if (replyTo) {
+ // For replies
+ content = `
+
+
+ On ${new Date(replyTo.date).toLocaleString()}, ${replyTo.from} wrote:
+
+
+ ${composeBody}
+
+
+ `;
+ } else if (forwardFrom) {
+ // For forwards
+ content = `
+
+
+ ---------- Forwarded message ---------
+ From: ${forwardFrom.from}
+ Date: ${new Date(forwardFrom.date).toLocaleString()}
+ Subject: ${forwardFrom.subject}
+ To: ${forwardFrom.to}
+ ${forwardFrom.cc ? `Cc: ${forwardFrom.cc}
` : ''}
+
+
+ ${composeBody}
+
+
+ `;
+ } else {
+ // For new messages
+ content = `
+