[Box Backup-dev] Re: [Box Backup] ChrisMerge_1828
Chris Wilson
boxbackup-dev@fluffy.co.uk
Fri, 14 Sep 2007 21:55:00 +0100 (BST)
Hi James,
On Fri, 14 Sep 2007, James O'Gorman wrote:
> On Fri, Sep 14, 2007 at 07:42:00PM +0100, Chris Wilson wrote:
>> Thanks for that! One more question, if I may: I'm not sure that this script
>> writes an error message to the system event log if sending the mail fails.
>> Is that possible, does it do it, and if so where or how?
>
> OK, it's easier than I thought. How about something like this?
>
> rc = objEmail.Send
> If rc Then
> WshShell.LogEvent EVENT_INFO, "Notification sent to " & sendto & "."
> Else
> WshShell.LogEvent EVENT_ERROR, "Failed to send notification to " & sendto & "."
> End If
>
> I couldn't decide whether to make the fact that it actually sent the
> mail an information message or a warning - what do you think? Feel free
> to make suggestions for the actual messages as well.
Looks great to me. Maybe worth sending the details of the message type to
the log as well?
Also, I reckon it should be:
* an error if the message was not sent; otherwise
* nothing if the message was "backup-start" or "backup-finish"; or
* a warning otherwise.
Cheers, Chris.
--
_____ __ _
\ __/ / ,__(_)_ | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |