Prev: Search a user and ad it to a group in all AD domain from file
Next: how to catch error: cant open ADODB connection
From: Gene. on 9 Jun 2010 00:54 Helo All After reading numerous posts and trying different things, I still have a problem. From looking at ms exchange server applet (contr. pannel) few things are: logon network security: password authentication (ntlm) exchange Server Settings / user Name: Lastnme, Frstnme ------- Here is my script: Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "gene.golub(a)sss.com" objMessage.To = "gene.golub(a)sss.com" objMessage.TextBody = "This is some sample message text." 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") = "server1.mail.sss.net" ' this is server name from my outlook email account 'Server port (typically 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverpor t") = 25 objMessage.Configuration.Fields.Update objMessage.Send ----- End. I am getting: c:\vb\t1.vbs(23, 1) CDO.Message.1: The transport failed to connect to the server. Could you advise anything ?
From: Pegasus [MVP] on 9 Jun 2010 04:31 "Gene." <Gene(a)discussions.microsoft.com> wrote in message news:128F5F67-F05F-407F-9264-D35929AA9126(a)microsoft.com... > Helo All > After reading numerous posts and trying different things, I still have a > problem. > From looking at ms exchange server applet (contr. pannel) few things are: > logon network security: password authentication (ntlm) > exchange Server Settings / user Name: Lastnme, Frstnme > > > ------- Here is my script: > Set objMessage = CreateObject("CDO.Message") > objMessage.Subject = "Example CDO Message" > objMessage.From = "gene.golub(a)sss.com" > objMessage.To = "gene.golub(a)sss.com" > objMessage.TextBody = "This is some sample message text." > > 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") > = "server1.mail.sss.net" ' this is server name from my outlook email > account > > 'Server port (typically 25) > objMessage.Configuration.Fields.Item _ > ("http://schemas.microsoft.com/cdo/configuration/smtpserverpor > t") = 25 > > objMessage.Configuration.Fields.Update > objMessage.Send > ----- End. I am getting: > > c:\vb\t1.vbs(23, 1) CDO.Message.1: The transport failed to connect to the > server. > > > Could you advise anything ? > There are a few things missing in your script. Try this code: const cdoBasic=1 schema = "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = CreateObject("CDO.Message") With objEmail .From = "James(a)company.com" .To = "Jim(a)company.com" .CC = "Boss(a)company.com" .Subject = "Test Mail" .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog" .AddAttachment "d:\Testfile.txt" With .Configuration.Fields .Item (schema & "sendusing") = 2 .Item (schema & "smtpserver") = "mail.company.com" .Item (schema & "smtpserverport") = 25 .Item (schema & "smtpauthenticate") = cdoBasic .Item (schema & "sendusername") = "James(a)company.com" .Item (schema & "smtpaccountname") = "James(a)company.com" .Item (schema & "sendpassword") = "SomePassword" End With .Configuration.Fields.Update .Send End With
From: Gene. on 9 Jun 2010 13:29 Thank you Pegasus, I had CreateObject(cdo.mesasge) in a script but did not copy to this post. All works now. It had to specify different mail server - not the one I had in a profile. "Pegasus [MVP]" wrote: > > > "Gene." <Gene(a)discussions.microsoft.com> wrote in message > news:128F5F67-F05F-407F-9264-D35929AA9126(a)microsoft.com... > > Helo All > > After reading numerous posts and trying different things, I still have a > > problem. > > From looking at ms exchange server applet (contr. pannel) few things are: > > logon network security: password authentication (ntlm) > > exchange Server Settings / user Name: Lastnme, Frstnme > > > > > > ------- Here is my script: > > Set objMessage = CreateObject("CDO.Message") > > objMessage.Subject = "Example CDO Message" > > objMessage.From = "gene.golub(a)sss.com" > > objMessage.To = "gene.golub(a)sss.com" > > objMessage.TextBody = "This is some sample message text." > > > > 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") > > = "server1.mail.sss.net" ' this is server name from my outlook email > > account > > > > 'Server port (typically 25) > > objMessage.Configuration.Fields.Item _ > > ("http://schemas.microsoft.com/cdo/configuration/smtpserverpor > > t") = 25 > > > > objMessage.Configuration.Fields.Update > > objMessage.Send > > ----- End. I am getting: > > > > c:\vb\t1.vbs(23, 1) CDO.Message.1: The transport failed to connect to the > > server. > > > > > > Could you advise anything ? > > > > There are a few things missing in your script. Try this code: > > const cdoBasic=1 > schema = "http://schemas.microsoft.com/cdo/configuration/" > Set objEmail = CreateObject("CDO.Message") > > With objEmail > .From = "James(a)company.com" > .To = "Jim(a)company.com" > .CC = "Boss(a)company.com" > .Subject = "Test Mail" > .Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog" > .AddAttachment "d:\Testfile.txt" > With .Configuration.Fields > .Item (schema & "sendusing") = 2 > .Item (schema & "smtpserver") = "mail.company.com" > .Item (schema & "smtpserverport") = 25 > .Item (schema & "smtpauthenticate") = cdoBasic > .Item (schema & "sendusername") = "James(a)company.com" > .Item (schema & "smtpaccountname") = "James(a)company.com" > .Item (schema & "sendpassword") = "SomePassword" > End With > .Configuration.Fields.Update > .Send > End With > > > . >
From: "Dave "Crash" Dummy" on 9 Jun 2010 14:07 Pegasus [MVP] wrote: > > > > "Gene." <Gene(a)discussions.microsoft.com> wrote in message > news:128F5F67-F05F-407F-9264-D35929AA9126(a)microsoft.com... >> Helo All After reading numerous posts and trying different things, >> I still have a problem. From looking at ms exchange server applet >> (contr. pannel) few things are: logon network security: password >> authentication (ntlm) exchange Server Settings / user Name: >> Lastnme, Frstnme >> >> >> ------- Here is my script: Set objMessage = >> CreateObject("CDO.Message") objMessage.Subject = "Example CDO >> Message" objMessage.From = "gene.golub(a)sss.com" objMessage.To = >> "gene.golub(a)sss.com" objMessage.TextBody = "This is some sample >> message text." >> >> 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") = >> "server1.mail.sss.net" ' this is server name from my outlook email >> account >> >> 'Server port (typically 25) objMessage.Configuration.Fields.Item _ >> ("http://schemas.microsoft.com/cdo/configuration/smtpserverpor t") >> = 25 >> >> objMessage.Configuration.Fields.Update objMessage.Send ----- End. I >> am getting: >> >> c:\vb\t1.vbs(23, 1) CDO.Message.1: The transport failed to connect >> to the server. >> >> >> Could you advise anything ? >> > > There are a few things missing in your script. Try this code: > > const cdoBasic=1 schema = > "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = > CreateObject("CDO.Message") > > With objEmail .From = "James(a)company.com" .To = "Jim(a)company.com" .CC > = "Boss(a)company.com" .Subject = "Test Mail" .Textbody = "The quick > brown fox " & Chr(10) & "jumps over the lazy dog" .AddAttachment > "d:\Testfile.txt" With .Configuration.Fields .Item (schema & > "sendusing") = 2 .Item (schema & "smtpserver") = "mail.company.com" > .Item (schema & "smtpserverport") = 25 .Item (schema & > "smtpauthenticate") = cdoBasic .Item (schema & "sendusername") = > "James(a)company.com" .Item (schema & "smtpaccountname") = > "James(a)company.com" .Item (schema & "sendpassword") = "SomePassword" > End With .Configuration.Fields.Update .Send End With I can send email okay, but can't figure out how to send NNTP postings. Could you give an example script for that? No, I am not spamming newsgroups. I periodically send desired update notices to some private newsgroups. I have a Perl script that I am currently using to do that, but I'd like to use VBScript so I could incorporate it in another script. -- Crash Morals allow predatory animals to live in large herds.
From: Pegasus [MVP] on 9 Jun 2010 18:09
"Dave "Crash" Dummy" <invalid(a)invalid.invalid> wrote in message news:JLQPn.46380$Ak3.1628(a)newsfe16.iad... > Pegasus [MVP] wrote: >> >> >> >> "Gene." <Gene(a)discussions.microsoft.com> wrote in message >> news:128F5F67-F05F-407F-9264-D35929AA9126(a)microsoft.com... >>> Helo All After reading numerous posts and trying different things, I >>> still have a problem. From looking at ms exchange server applet (contr. >>> pannel) few things are: logon network security: password authentication >>> (ntlm) exchange Server Settings / user Name: Lastnme, Frstnme >>> >>> >>> ------- Here is my script: Set objMessage = CreateObject("CDO.Message") >>> objMessage.Subject = "Example CDO Message" objMessage.From = >>> "gene.golub(a)sss.com" objMessage.To = "gene.golub(a)sss.com" >>> objMessage.TextBody = "This is some sample message text." >>> >>> 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") = >>> "server1.mail.sss.net" ' this is server name from my outlook email >>> account >>> >>> 'Server port (typically 25) objMessage.Configuration.Fields.Item _ >>> ("http://schemas.microsoft.com/cdo/configuration/smtpserverpor t") >>> = 25 >>> >>> objMessage.Configuration.Fields.Update objMessage.Send ----- End. I >>> am getting: >>> >>> c:\vb\t1.vbs(23, 1) CDO.Message.1: The transport failed to connect to >>> the server. >>> >>> >>> Could you advise anything ? >>> >> >> There are a few things missing in your script. Try this code: >> >> const cdoBasic=1 schema = >> "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = >> CreateObject("CDO.Message") >> >> With objEmail .From = "James(a)company.com" .To = "Jim(a)company.com" .CC >> = "Boss(a)company.com" .Subject = "Test Mail" .Textbody = "The quick brown >> fox " & Chr(10) & "jumps over the lazy dog" .AddAttachment >> "d:\Testfile.txt" With .Configuration.Fields .Item (schema & "sendusing") >> = 2 .Item (schema & "smtpserver") = "mail.company.com" .Item (schema & >> "smtpserverport") = 25 .Item (schema & "smtpauthenticate") = cdoBasic >> .Item (schema & "sendusername") = "James(a)company.com" .Item (schema & >> "smtpaccountname") = "James(a)company.com" .Item (schema & "sendpassword") >> = "SomePassword" >> End With .Configuration.Fields.Update .Send End With > > I can send email okay, but can't figure out how to send NNTP postings. > Could you give an example script for that? > > No, I am not spamming newsgroups. I periodically send desired update > notices to some private newsgroups. I have a Perl script that I am > currently using to do that, but I'd like to use VBScript so I could > incorporate it in another script. > -- > Crash > > Morals allow predatory animals to live in large herds. Sorry, I've never tried this, no idea. "Morals allow predatory animals to live in large herds". Really? |