Home › Forums › Bug Reports › SwithMail Bug Reports › Ignore attachment errors and proceed to send the email anyway.
Tagged: attachments
- This topic has 6 replies, 3 voices, and was last updated 3 years ago by
onlinestatements.
-
AuthorPosts
-
-
nitinkan
ParticipantRequest to add functionality to swithmail: Attempt to send email even when there is a failure to access one (or more attachments), and log an error in the log file and conditionally to the bottom of the email body or as an error.log attachment.
-
interesting – I’ll look into this. Shouldn’t be too hard to implement.
-
nitinkan
ParticipantThis reply has been marked as private. -
I second this feature to ignore attachment doesnt exist
Not all of my messages have attachments and I don’t want the ones that don’t to fail to send -
I haven’t had a chance yet – been a really busy month+ for me, but it’s still on my radar.
Thanks for the suggestion, and I’ll post back on here when I have an update pushed.
-
I figured out a workaround and can get the email to send with or without an attachment.
if exist "%confirmdir%\confirms\!attachname!!atname!" echo !filename: =!.attachments!atname! & set attachexist=yes
if "!attachexist!" EQU "yes" set checkattach=^/a "%confirmdir%\confirms\extract\!attachfile: =!"
then in the swith command line I place the checkattach !variable!
between the subject and body text settings like:/sub "email subject" !checkattach! /btxt "emailbodytext.txt"
so now if the attachment doesn’t exist the variable will be empty and no /a will be attached to the command
Also if you are running your script in a for loop be sure to clear the checkattach variable at the start of the loop like
set checkattach=
-
This reply was modified 3 years ago by
onlinestatements.
-
the echo filename is of course optional.
I just wanted to display the name of the attachment when sending the email if an attachment exists.
-
This reply was modified 3 years ago by
-
-
AuthorPosts
- You must be logged in to reply to this topic.