EMail script fails from Server 2008 only
- From: K Walsh <KWalsh@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Sep 2008 08:43:01 -0700
Hi there,
I've been struggling with this problem for 2 months, the Microsoft Partner
group pointed me here. It feels like a simple problem, but clearly not.
Basically I have a script that sends emails after backup jobs complete. On
any server 2003 machine the script works fine.
If I run it from a server 2008 machine I get a logon box which comes from
our Exchange 2007 server at the office. If I leave this blank and hit
'cancel', then the email works so it obviously picks up the authentication
information from my script.
If I hit "OK" at the popup box then the script fails. I believe that this is
because the blank values in the authentication box overwrite the
authentication values in the script.
Here is my pretty basic script
================================
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service
pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over
the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Email script"
objMessage.From = "backupreport@xxxxxxxxxxxxxxxx"
objMessage.To = "me@xxxxxxxxxxxxxx"
objMessage.TextBody = "Test Email"
'==This section provides the configuration information for the remote SMTP
server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.domainname.co.uk"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoNTLM
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"backupreport"
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a
connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
==========================================
Can anyone please help with this?
.
- Prev by Date: Re: Inserting LDAP server into connection string??
- Next by Date: vbscript registry exist then......
- Previous by thread: Inserting LDAP server into connection string??
- Next by thread: vbscript registry exist then......
- Index(es):
Relevant Pages
|