mailsend icon indicating copy to clipboard operation
mailsend copied to clipboard

How to attach unknown files

Open SebastianZitzl opened this issue 9 years ago • 2 comments

Hi,

i´m new to mailsend and i want to attach a file, which has an individual name every time it is created. I tried * and *.extension but nothing worked. Can you help me?

@echo off

mailsend.exe -to [email protected] -from [email protected] -ssl -port 465 -auth -smtp >smtp.domain.top ^ -sub Subject -user [email protected] -pass password -attach "C:\test\Inbox*.pdf"

Pause

Thank you.

SebastianZitzl avatar Jan 10 '16 19:01 SebastianZitzl

mailsend itself does not support wildcard yet. You've to write a script to figure out the filename and call mailsend.

Thanks.

muquit avatar Jan 10 '16 21:01 muquit

Thank you, here´s my working code:

@echo off

for /f %%i in ('dir /b /s /a-d "Path_to_file*.tif"') do set "filevariable=%%~ni"

mailsend.exe -to [email protected] -cc [email protected] -from [email protected] -ssl -port 465 -auth -smtp smtp.domain.com -sub Subject -user [email protected] -pass password -attach >"Path_to_file%filevariable%.tif"

SebastianZitzl avatar Jan 12 '16 18:01 SebastianZitzl