![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Unable to send Mail Using vbscript Hi I have modified a script to send a mail with a file attachment. Please find the script bellow. Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Free Disk Space Report" objMessage.Sender = "sample@xxxxxx" objMessage.To = "sample@xxxxxx" objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") objMessage.Send Set objMessage = nothing The above script works perfectly in a workgroup If I try to execute the same script in domain. Its giving a error as "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value is invalid" Can any one please give some tips to avoid this error. Thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Unable to send Mail Using vbscript "Mark" <Mark@xxxxxx> wrote in message news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx Quote: > Hi > > I have modified a script to send a mail with a file attachment. Please > find > the script bellow. > > Set objMessage = CreateObject("CDO.Message") > objMessage.Subject = "Free Disk Space Report" > objMessage.Sender = "sample@xxxxxx" > objMessage.To = "sample@xxxxxx" > objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") > objMessage.Send > Set objMessage = nothing > > The above script works perfectly in a workgroup If I try to execute the > same > script in domain. Its giving a error as > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value is > invalid" > > Can any one please give some tips to avoid this error. > > Thanks server. Try this version: schema = "http://schemas.microsoft.com/cdo/configuration/" Set objEmail = CreateObject("CDO.Message") With objEmail .From = "James@xxxxxx" .To = "Jim@xxxxxx" .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@xxxxxx" .Item (schema & "sendpassword") = "SomePassword" End With .Configuration.Fields.Update .Send End With |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Unable to send Mail Using vbscript On Nov 13, 1:02*am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: Quote: > "Mark" <M...@xxxxxx> wrote in message > > news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx > > > > > Quote: > > Hi Quote: > > I have modified a script to send a mail with a file attachment. Please > > find > > the script bellow. Quote: > > Set objMessage = CreateObject("CDO.Message") > > * *objMessage.Subject = "Free Disk Space Report" > > * *objMessage.Sender = "sam...@xxxxxx" > > * *objMessage.To = "sam...@xxxxxx" > > * *objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") > > * *objMessage.Send > > Set objMessage = nothing Quote: > > The above script works perfectly in a workgroup If I try to execute the > > same > > script in domain. Its giving a error as > > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration valueis > > invalid" Quote: > > Can any one please give some tips to avoid this error. Quote: > > Thanks > It seems there are a few settings missing from your script, e.g. your SMTP > server. Try this version: > > schema = "http://schemas.microsoft.com/cdo/configuration/" > Set objEmail = CreateObject("CDO.Message") > With objEmail > *.From = "Ja...@xxxxxx" > *.To = "J...@xxxxxx" > *.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") = "Ja...@xxxxxx" > * .Item (schema & "sendpassword") = "SomePassword" > *End With > *.Configuration.Fields.Update > *.Send > End With- Hide quoted text - > > - Show quoted text - '<------------Begin-----------------------------------------------> adminmail = "somebody@xxxxxx" ' smtp = "mail_server name or IP" Set mailing = CreateObject("CDO.Message") Set wshNet = CreateObject("WScript.Network") mailing.From = ("fromSomeone@xxxxxx") mailing.To = adminmail mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/sendusing") = 2 mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/smtpserver") = smtp mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/smtpserverport") = 25 mailing.Subject = header & "Data Transfer Success logs" sFullProductionMessage = "See attached file..." & vbcrlf mailing.TextBody = sFullProductionMessage mailing.Configuration.Fields.Update mailing.AddAttachment "R:\dailylog.txt" mailing.Send On Error Goto 0 '<---------------------------- END ----------------------------------- Quote: > Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") 'Open the file for reading Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading) 'The ReadAll method reads the entire file into the variable BodyText BodyText = f.ReadAll 'Close the file f.Close Set f = Nothing Set fso = Nothing And in your message function or sub or whatever; mailing.TextBody = BodyText How about CC? mailing.Cc = "someoneelse@xxxxxx" OldDog |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Unable to send Mail Using vbscript "OldDog" <mikef2691@xxxxxx> wrote in message news:14c820ff-e2c7-4678-9496-94ebeaded113@xxxxxx On Nov 13, 1:02 am, "Pegasus \(MVP\)" <I....@xxxxxx> wrote: Quote: > "Mark" <M...@xxxxxx> wrote in message > > news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx > > > > > Quote: > > Hi Quote: > > I have modified a script to send a mail with a file attachment. Please > > find > > the script bellow. Quote: > > Set objMessage = CreateObject("CDO.Message") > > objMessage.Subject = "Free Disk Space Report" > > objMessage.Sender = "sam...@xxxxxx" > > objMessage.To = "sam...@xxxxxx" > > objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") > > objMessage.Send > > Set objMessage = nothing Quote: > > The above script works perfectly in a workgroup If I try to execute the > > same > > script in domain. Its giving a error as > > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value > > is > > invalid" Quote: > > Can any one please give some tips to avoid this error. Quote: > > Thanks > It seems there are a few settings missing from your script, e.g. your SMTP > server. Try this version: > > schema = "http://schemas.microsoft.com/cdo/configuration/" > Set objEmail = CreateObject("CDO.Message") > With objEmail > .From = "Ja...@xxxxxx" > .To = "J...@xxxxxx" > .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") = "Ja...@xxxxxx" > .Item (schema & "sendpassword") = "SomePassword" > End With > .Configuration.Fields.Update > .Send > End With- Hide quoted text - > > - Show quoted text - '<------------Begin-----------------------------------------------> adminmail = "somebody@xxxxxx" ' smtp = "mail_server name or IP" Set mailing = CreateObject("CDO.Message") Set wshNet = CreateObject("WScript.Network") mailing.From = ("fromSomeone@xxxxxx") mailing.To = adminmail mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/sendusing") = 2 mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/smtpserver") = smtp mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/ configuration/smtpserverport") = 25 mailing.Subject = header & "Data Transfer Success logs" sFullProductionMessage = "See attached file..." & vbcrlf mailing.TextBody = sFullProductionMessage mailing.Configuration.Fields.Update mailing.AddAttachment "R:\dailylog.txt" mailing.Send On Error Goto 0 '<---------------------------- END ----------------------------------- Quote: > Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") 'Open the file for reading Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading) 'The ReadAll method reads the entire file into the variable BodyText BodyText = f.ReadAll 'Close the file f.Close Set f = Nothing Set fso = Nothing And in your message function or sub or whatever; mailing.TextBody = BodyText How about CC? mailing.Cc = "someoneelse@xxxxxx" OldDog ========================= You're replying to me - are you asking me a question? |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Unable to send Mail Using vbscript easy in VBS: Set WshNetwork = WScript.CreateObject("WScript.Network") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objEmail = CreateObject("CDO.Message") objEmail.From = "user@xxxxxx" objEmail.To = "user@xxxxxx" objEmail.Subject = "Subject Line" objEmail.Textbody = "" objEmail.AddAttachment "c:\folder\filename.extension" objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ "exchangeservername" objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objEmail.Configuration.Fields.Update objEmail.Send "Mark" <Mark@xxxxxx> wrote in message news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx Quote: > Hi > > I have modified a script to send a mail with a file attachment. Please > find > the script bellow. > > Set objMessage = CreateObject("CDO.Message") > objMessage.Subject = "Free Disk Space Report" > objMessage.Sender = "sample@xxxxxx" > objMessage.To = "sample@xxxxxx" > objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") > objMessage.Send > Set objMessage = nothing > > The above script works perfectly in a workgroup If I try to execute the > same > script in domain. Its giving a error as > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value is > invalid" > > Can any one please give some tips to avoid this error. > > Thanks |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Unable to send Mail Using vbscript Hi Thanks Its works fine But I am using a pop3 mail account type. When I put cc to my gmail account I am get any mail in gmail. But the mail reach to the addressed person on TO. Can you explane me how to sort out this problem. "Pegasus (MVP)" wrote: Quote: > > "Mark" <Mark@xxxxxx> wrote in message > news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx Quote: > > Hi > > > > I have modified a script to send a mail with a file attachment. Please > > find > > the script bellow. > > > > Set objMessage = CreateObject("CDO.Message") > > objMessage.Subject = "Free Disk Space Report" > > objMessage.Sender = "sample@xxxxxx" > > objMessage.To = "sample@xxxxxx" > > objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") > > objMessage.Send > > Set objMessage = nothing > > > > The above script works perfectly in a workgroup If I try to execute the > > same > > script in domain. Its giving a error as > > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value is > > invalid" > > > > Can any one please give some tips to avoid this error. > > > > Thanks > It seems there are a few settings missing from your script, e.g. your SMTP > server. Try this version: > > schema = "http://schemas.microsoft.com/cdo/configuration/" > Set objEmail = CreateObject("CDO.Message") > With objEmail > .From = "James@xxxxxx" > .To = "Jim@xxxxxx" > .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@xxxxxx" > .Item (schema & "sendpassword") = "SomePassword" > End With > .Configuration.Fields.Update > .Send > End With > > > |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Unable to send Mail Using vbscript Let's have a look at your current script. "Mark" <Mark@xxxxxx> wrote in message news:77655070-89F6-4E5F-A538-DD31391EFC0A@xxxxxx Quote: > Hi Thanks Its works fine > But I am using a pop3 mail account type. When I put cc to my gmail account > I > am get any mail in gmail. But the mail reach to the addressed person on > TO. > > Can you explane me how to sort out this problem. > > > "Pegasus (MVP)" wrote: > Quote: >> >> "Mark" <Mark@xxxxxx> wrote in message >> news:06B7187B-E589-443C-B2C4-29E2A7165EE2@xxxxxx Quote: >> > Hi >> > >> > I have modified a script to send a mail with a file attachment. Please >> > find >> > the script bellow. >> > >> > Set objMessage = CreateObject("CDO.Message") >> > objMessage.Subject = "Free Disk Space Report" >> > objMessage.Sender = "sample@xxxxxx" >> > objMessage.To = "sample@xxxxxx" >> > objMessage.AddAttachment ("C:\Diskspace_"& testdate &".log") >> > objMessage.Send >> > Set objMessage = nothing >> > >> > The above script works perfectly in a workgroup If I try to execute the >> > same >> > script in domain. Its giving a error as >> > "C:\Sample.vbs(7, 5) CDO.Message.1: The "SendUsing" configuration value >> > is >> > invalid" >> > >> > Can any one please give some tips to avoid this error. >> > >> > Thanks >> It seems there are a few settings missing from your script, e.g. your >> SMTP >> server. Try this version: >> >> schema = "http://schemas.microsoft.com/cdo/configuration/" >> Set objEmail = CreateObject("CDO.Message") >> With objEmail >> .From = "James@xxxxxx" >> .To = "Jim@xxxxxx" >> .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@xxxxxx" >> .Item (schema & "sendpassword") = "SomePassword" >> End With >> .Configuration.Fields.Update >> .Send >> End With >> >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Unable to send mail | Vista mail | |||
| Unable to send mail | Vista mail | |||
| Unable to send e-mail | Vista mail | |||
| I am unable to send e-mail | Vista mail | |||
| unable to send mail | Vista mail | |||