MCPcopy Create free account
hub / github.com/pollinations/pollinations / sendEmailWithAttachments

Function sendEmailWithAttachments

apps/micro/examples/resend-example.js:112–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111// Example 5: Send with attachments
112async function sendEmailWithAttachments() {
113 try {
114 console.log('📧 Sending email with attachments via Resend...');
115
116 const result = await emailService.sendMail({
117 to: 'user@example.com',
118 subject: 'Document Attached',
119 html: '<p>Please find the attached document.</p>',
120 attachments: [
121 {
122 filename: 'document.pdf',
123 content: 'base64-encoded-content-here',
124 contentType: 'application/pdf',
125 },
126 ],
127 });
128
129 if (result.success) {
130 console.log('✅ Email with attachments sent successfully!', result.messageId);
131 } else {
132 console.error('❌ Failed to send email with attachments:', result.error);
133 }
134 } catch (error) {
135 console.error('❌ Error:', error.message);
136 }
137}
138
139// Example 6: Verify Resend connection
140async function verifyResendConnection() {

Callers 1

runExamplesFunction · 0.85

Calls 3

logMethod · 0.80
errorMethod · 0.80
sendMailMethod · 0.65

Tested by

no test coverage detected