How to attach unknown files
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.
mailsend itself does not support wildcard yet. You've to write a script to figure out the filename and call mailsend.
Thanks.
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"