![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello there I am trying to run xp_sendmail with an attachment. I have two attachments file1.txt and file2.txt, but I'd like implement in the xp_sendmail a condition where if file1.txt does not exist still attaches file2.txt and send the email Here is the sql i wrote so far, and is not quite working yet, declare @msg varchar(2000) declare @cr char(1) set @cr = char(13) set @msg = 'Check Income Statement and Balance Sheet to confirm accuracy of the data load.' print @msg exec master..xp_sendmail @recipients = 'jdoe (AT) msfot (DOT) com', @message = @msg, @attachments = case @echo_error when true 'E:\WHC_Reject.log' else 'E:\Load_Report.txt' end, @subject = 'Daily data load' any help is highly appreciated!! thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |