You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: "Hello, this is a test email sent from Next.js.",
128
+
list: {
129
+
subscribe: [
130
+
'<mailto:admin@example.com?subject=subscribe>',
131
+
{
132
+
url: "http://www.example.com/subscribe",
133
+
comment: "Subscribe"
134
+
}
135
+
],
136
+
unsubscribe: {
137
+
url: "http://www.example.com/unsubscribe",
138
+
comment: "Unsubscribe"
139
+
}
140
+
}
141
+
};
142
+
143
+
let info = await transporter.sendMail(mailOptions);
144
+
console.log("Email sent:", info.messageId);
115
145
116
-
await transporter.sendMail(mailOptions);
117
-
res.status(200).json({ message: "Email sent successfully!" });
146
+
return res.status(200).json({ message: "Email sent successfully!" });
147
+
} catch (error) {
148
+
console.error("Error sending email:", error);
149
+
return res.status(500).json({ error: "Failed to send email." });
150
+
}
118
151
}
119
152
`}
120
153
</Highlight>
@@ -373,7 +406,7 @@ send_email()
373
406
<p>
374
407
در قطعه کدهای فوق، بهجای <Important>http://www.example.com/subscribe</Important> و <Important>http://www.example.com/unsubscribe</Important>، آدرسهای مربوط به صفحههای Subscribe و Unsubscribe خود را قرار دهید.
375
408
همچنین، عبارت <Important>(Click here to subscribe/unsubscribe to our mailing list)</Important> که یک نوع comment میباشد را، میتوانید تغییر دهید. البته
376
-
این نوع comment در NodeJS و NextJS قابل استفاده، نیست.
409
+
این نوع comment در NodeJS و NextJS در فیلد <Important>comment</Important>، قرار میگیرد.
0 commit comments