initial update

This commit is contained in:
jackbeeby
2025-05-15 13:32:55 +10:00
commit 7b07a49fbe
4412 changed files with 909535 additions and 0 deletions

42
sendEmail.ts Normal file
View File

@@ -0,0 +1,42 @@
import nodemailer from 'nodemailer'; // if using ESModules
// const nodemailer = require('nodemailer'); // if using CommonJS
export async function sendEmail(formData: {
name: string;
email: string;
phone?: string;
location?: string;
info?: string;
}) {
const transporter = nodemailer.createTransport({
host: 'smtp.titan.email',
port: 465,
secure: true,
auth: {
user: 'contact@jackbeeby.au',
pass: 'Charlie2017$',
},
});
const mailOptions = {
from: '"Jack Beeby" <contact@jackbeeby.au>',
to: 'beebyjack1@gmail.com',
subject: 'Photography Client Notification',
text: `
New photography enquiry received:
Name: ${formData.name}
Email: ${formData.email}
Phone: ${formData.phone || 'N/A'}
Location: ${formData.location || 'N/A'}
Info: ${formData.info || 'N/A'}
`,
};
try {
const info = await transporter.sendMail(mailOptions);
console.log('Message sent:', info.messageId);
} catch (error) {
console.error('Error sending mail:', error);
}
}