add API origin to fetchUrl

This commit is contained in:
ProgrammerIn-wonderland committed 2026-09-11 18:46:03 -04:00
1 parent ecc1804630
commit 784f8c4e73
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ export class EmailModule extends PuterModule {
});
send = async (options) => {
const req = await fetchUrl("/email/send", {includePuterAuth: true, body: new Blob([await compose(options)], {type: 'message/rfc822'})});
const req = await fetchUrl(`${this.APIOrigin}/email/send`, { method: "POST", includePuterAuth: true, body: new Blob([await compose(options)], { type: 'message/rfc822' }) });
return await req.json();
}
}
@@ -191,7 +191,7 @@ export async function compose({ from, to, cc, bcc, subject, replyTo, attachments
} else {
// Add From Block (hardcoded to puter.email for now)
const userinfo = await puter.getUser();
headerLines += emlHeader('From', userinfo + '@puter.email');
headerLines += emlHeader('From', userinfo.username + '@puter.email');
}
const { isMultiPart, mimeType } = determineTopLevelMimeType({ attachments, text, html });