Web Developer
Getting the above error in execution tab while running on appwrite cloud.
I am trying to send emails from node:appwrite and nodemailer as well but both are showing the above error.
functionId: 673ccc4600223a53680e
Votes
0
Replies
7
Participants
Unknown
Messages
8
Web Developer
Getting the above error in execution tab while running on appwrite cloud.
I am trying to send emails from node:appwrite and nodemailer as well but both are showing the above error.
functionId: 673ccc4600223a53680e
Your function is probably timing out. Maybe from incorrect mail settings
What's your code and how are you executing your function?
Rank 1: Thread
// const sdk = require('node-appwrite');const nodemailer = require('nodemailer');
// Initialize the Mail Service// const mailService = new sdk.Messaging(client);
export default async (context) => {
try { context.log(context.req.bodyJson); context.log(context.req.bodyJson); const payload = context.req.bodyJson; // The data passed when triggering the function // Retrieve email and other relevant details const email = payload.email; const petName = payload.petName;
const transporter = nodemailer.createTransport({ host: 'smtp.gmail.com', port: 587, secure: false, auth: { user: process.env.emailUser, pass: process.env.emailPassword, }, });
const mailOptions = { from: '', to: email, subject: 'subject', html: 'html', }; transporter.sendMail(mailOptions, (err, info) => { if (err) { context.error(err); } else { context.log('sent'); } }); return context.res.json({ success: true, message: 'Email sent successfully.' }); } catch (err) { context.error('Error sending email:', err); return context.res.json({ success: false, error: err.message }); }};Rank 1: Thread
This is the approach i've used for sending mails using nodemailer, i've also tried using node:appwrite but no luck.
This seems okay. I'd have to troubleshoot this with you when I'm at a computer tomorrow.
Would you please also share your project id and deployment id?
Rank 1: Thread
Here's the latest deployment ID: 673ce25bf082a75070ba
project id: 673857a800117f69b1e3
Rank 1: Thread
Hi @Steven any update on this please ?