Fix himalaya command: use 'smtp send' with --mail-from/--rcpt-to flags
This commit is contained in:
parent
660db975e4
commit
61c5830028
3 changed files with 11 additions and 3 deletions
|
|
@ -218,7 +218,11 @@ ${pdfB64}\r
|
|||
writeFileSync(emlPath, eml, "utf8");
|
||||
|
||||
try {
|
||||
execSync(`himalaya -a dyfins --backend smtp email send < "${emlPath}"`, { timeout: 30 });
|
||||
// Extract recipients from EML for himalaya smtp send
|
||||
const emlContent = readFileSync(emlPath, "utf8");
|
||||
const toMatch = emlContent.match(/^To:\s*(.+)$/m);
|
||||
const toAddresses = toMatch ? toMatch[1].trim() : "";
|
||||
execSync(`himalaya -a dyfins smtp send --mail-from SJ@Dyfins.com --rcpt-to "${toAddresses}" < "${emlPath}"`, { timeout: 30 });
|
||||
} finally {
|
||||
unlinkSync(emlPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ ${body}\r
|
|||
writeFileSync(emlPath, eml, "utf8");
|
||||
|
||||
try {
|
||||
execSync(`himalaya -a dyfins --backend smtp email send < "${emlPath}"`, { timeout: 30 });
|
||||
// Extract recipients from EML for himalaya smtp send
|
||||
const emlContent = readFileSync(emlPath, "utf8");
|
||||
const toMatch = emlContent.match(/^To:\s*(.+)$/m);
|
||||
const toAddresses = toMatch ? toMatch[1].trim() : "";
|
||||
execSync(`himalaya -a dyfins smtp send --mail-from SJ@Dyfins.com --rcpt-to "${toAddresses}" < "${emlPath}"`, { timeout: 30 });
|
||||
} finally {
|
||||
unlinkSync(emlPath);
|
||||
if (pdfPath && pdfPath.length > 0) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue