I have a script to email a backup log once per day.
The script runs fine, but the attachment has problems.
If there is a period (.) in the body of the attachment, anything after that
is screwed up.
Any idea why a period would be causing such a problem? And is there a fix?
I can always write code to replace the (.) with something else if need be.
Here is what the attachment should look like:
<--- begin attachment content--->
Backup Status
Operation: Backup
Active backup destination: File
Media name: "dans.bkf created 5/26/2004 at 10:55 AM"
Backup (via shadow copy) of "C: "
Backup set #1 on media #1
Backup description: "Daily"
Media name: "dans.bkf created 5/26/2004 at 10:55 AM"
Backup Type: Normal
Backup started on 5/26/2004 at 10:55 AM.
Backup completed on 5/26/2004 at 10:55 AM.
Directories: 6
Files: 21
Bytes: 61,855,252
Time: 10 seconds
----------------------
<--- end attachment content--->
But here is what I get:
<--- begin attachment content--->
Backup Status
Operation: Backup
Active backup destination: File
Media name:
"dans???? ??????? ????????? ?? ????? ????????????? ???? ?????? ????? ?? ???
????????? ??? ?? ?? ????? ?????????? ???????????? ?????????????? ????? ?????
?.bkf created 5/26/2004 at 10:55 AM"
Backup Type: Normal
Backup started on 5/26/2004 at 10:55
AM????????? ????????? ?? ????????? ?? ????? ???.
Directories: 6
Files: 21
Bytes: 61,855,252
Time: 10 seconds
----------------------
?
<--- end attachment content--->
Here is my code:
MAIL_FROM = "user@domain.com"
MAIL_TO = "me@domain.com"
MAIL_SUBJECT = "Backup for morning of: " & date
MAIL_SERVER = "10.1.1.4"
LOG_FILE = "C:\NTBackup\logs\backup.txt"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = MAIL_FROM
objEmail.To = MAIL_TO
objEmail.Subject = MAIL_SUBJECT
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MAIL_SERVER
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.AddAttachment LOG_FILE
objEmail.Configuration.Fields.Update
objEmail.Send
Thanks,
Dan
--
__o
_-\<,
(_)/(_)____