Home Forums Bug Reports SwithMail Bug Reports Ignore attachment errors and proceed to send the email anyway.

Tagged: 

Viewing 5 reply threads
  • Author
    Posts
    • #445 Score: 0
      nitinkan
      Participant

      Request 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.

    • #449 Score: 0
      tbare
      Keymaster
      2 pts

      interesting – I’ll look into this. Shouldn’t be too hard to implement.

    • #538 Score: 0
      nitinkan
      Participant
      This reply has been marked as private.
    • #545 Score: 0
      onlinestatements
      Participant
      1 pt

      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

    • #549 Score: 0
      tbare
      Keymaster
      2 pts

      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.

    • #565 Score: 1
      onlinestatements
      Participant
      1 pt

      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=

      • #569 Score: 0
        onlinestatements
        Participant
        1 pt

        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.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.