I am generating message.txt from a MSSQL database. As soon as the e-mail is sent, I delete message.txt and loop onto the next MSSQL result.
The problem is, i have to insert a 10 second pause in between the Start-Process line and deleting the message.txt file. Otherwise mailsend doesn't work. I guess Powershell moves onto the delete line whilst mailsend is authenticating so the message.txt has gone by the time mailsend needs it.
is there a more elegant way to fix this than the 10 second pause?
Hi I am sending e-mail using mailsend 1.17b15 from a powershell script.
Start-Process -FilePath 'C:\Email\mailsend1.17b15.exe' -ArgumentList $myargs
but the argument list includes -msg-body
-msg-body "C:\Email\message.txt"
I am generating message.txt from a MSSQL database. As soon as the e-mail is sent, I delete message.txt and loop onto the next MSSQL result.
The problem is, i have to insert a 10 second pause in between the Start-Process line and deleting the message.txt file. Otherwise mailsend doesn't work. I guess Powershell moves onto the delete line whilst mailsend is authenticating so the message.txt has gone by the time mailsend needs it.
is there a more elegant way to fix this than the 10 second pause?
thanks!