1

I've got a rather odd problem (don't we all...) whereas the below (de-corporatized) Sub() works just fine on our old Windows 2003 server, but refuses to work on Windows 2008 R2:

Old OS: Windows Server 2003 64-bit

Old Eniv.: IIS 6.0 w/ Virtual SMTP Server configured to relay mail through Enterprise SMTP relay.

sub SendMail()
on error resume next

  'Send Mail vars
  Dim ObjSendMail
  Dim iConf
  Dim Flds

  Set ObjSendMail = CreateObject("CDO.Message")
  Set iConf = CreateObject("CDO.Configuration")
  Set Flds = iConf.Fields

  Set ObjSendMail.Configuration = iConf
    ObjSendMail.To = "dba1@blah.com;dba2@blah.com;dba3@blah.com"
    ObjSendMail.Subject = "Daily Primary Load Has Completed"
    ObjSendMail.From = "app-server@blah.com"

  ObjSendMail.Send
  Set ObjSendMail = Nothing
end Sub

New OS: Windows Server 2008 R2 64-bit

New Eniv.: IIS 7.5 w/ IIS 6.0 Manager & Compatibility w/ Virtual SMTP Server configured to relay mail through Enterprise SMTP relay (configured identical settings to Old server).

Every time I try to run the exact script above on the new machine, I get the very helpful error message of:

C:\Users\digitalnoise\email_test.vbs(21, 4) CDO.Message.1: The "SendUsing" configuration value is invalid.

I didn't develop this system or these scripts, and those that did are long gone, and it's fallen to me to maintain. Unfortunately I've never used VBScripting to automate things (I've used other items, but my view is changing), and so I'm just not familiar with this or how to figure out why my config isn't working.

I've been at this a couple of weeks, and most of the results I've come up with either won't work (MS's Remote SMTP Schema - servers don't have access to internet), or seem to apply specifically to VBScript in ASP.Net pages - which these scripts are not.

Things I have done:

  • Stopped & Restarted the SMTP Service after configuring the Virtual Server
  • Stopped & Restarted the Virtual SMTP Server after configuring it.
  • Stopped & Restarted IIS

Anyone have any ideas?

  • You didn't actually [configure](http://stackoverflow.com/a/17425519/1630171) the `CDO.Configuration` object. – Ansgar Wiechers Oct 15 '13 at 20:14
  • @AnsgarWiechers - the script I posted works as-is on the old server - no where in the VBS file are there any other mentions of CDO - I know, I've searched multiple times. The link you posted still uses `schema = "http://schemas.microsoft.com/cdo/configuration/"` which I can't use, because our internal only servers don't have internet connectivity, plus it's not even a part of the original script, yet that script works. – DigitalNoise Oct 15 '13 at 20:38
  • Have you tried adjusting your code to the example I referred you to? – Ansgar Wiechers Oct 15 '13 at 20:40
  • @AnsgarWiechers - Yes, and as I predicted, it doesn't work - there is no connectivity from the host machine it is running on to the internet. However, the local SMTP server works - I've telneted into it on the localhost and send email to myself through the internal Enterprise SMTP relay. There has to be a way to use the CDO object without using the external schema - it's being done on the old server, exactly as my example shows, but we don't know /how/. – DigitalNoise Oct 17 '13 at 21:45
  • I just tested the code from the answer I linked to on a Windows box with no Internet connection, and it worked just fine (sending mail to an MTA on the same network segment). – Ansgar Wiechers Oct 21 '13 at 21:39
  • possible duplicate of [Can not send mail using smtp.gmail.com, port 587 from vbs script](http://stackoverflow.com/questions/28605803/can-not-send-mail-using-smtp-gmail-com-port-587-from-vbs-script) – Paul Sweatte Jul 01 '15 at 21:40

0 Answers0