Windows Vista Forums

VBScript - CDO.message

  1. #1


    Join Date : Apr 2012
    Posts : 2
    Vista Home Premium
    Local Time: 19:37
    uk

    VBScript - CDO.message

    Hello. I have tried this VBScript on my mothers Vista Home Premium & it works.

    Set Msg = CreateObject("CDO.Message")
    With Msg
    .To = "cashcashjonny@yahoo.com"
    .From = "bananaman@mymail.com"
    .Subject = "Hello"
    .TextBody = "sample CDO message"
    .Send
    End With

    But to do the same thing on my windows 7, I need to add SMTP server details like this:

    Const fromEmail = "me@gmail.com"
    Const password = "*******"
    Dim msg, emailConfig
    Set msg = CreateObject("CDO.Message")
    With Msg
    .From = fromEmail
    .To = "cashcashjonny@yahoo.com"
    .Subject = "Hello"
    .TextBody ="sample CDO message"
    Set emailConfig = msg.Configuration
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = fromEmail
    emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password
    emailConfig.Fields.Update
    .Send
    End With
    Set msg = nothing
    Set emailConfig = nothing

    I want to know if the first script works on all vista machines or if it only works because of something else (maybe the network card), so I will know whether to get a copy of vista or a different network card - (ultimately I want to send email without logging on to a SMTP server or going round to borrow my mums computer).

    Any intelligence you can supply in relation to this matter would be much appreciated.
    Thanks.

      My System SpecsSystem Spec

  2. #2


    Join Date : Apr 2012
    Posts : 2
    Vista Home Premium
    Local Time: 19:37
    uk

      Thread Starter

    Re: VBScript - CDO.message

    Answer recieved and solution found (if anybody is interested)

    @

    ScriptingAnswers Forums: CDO.message - resolved


      My System SpecsSystem Spec

VBScript - CDO.message

Similar Threads
Thread Forum
are VBscript on Windows server 2003 and VBscript on WS2008 compatible?
Hi everybody, Sorry if my question has already been asked, but I haven't found anything which is clear for me on this point. I spent a lot of...
VB Script
Can a vbscript identify the program/process that called a vbscript
I would like to code a vbscript ("ActionScript.vbs") in such a way that it would do X, if ActionScript.vbs were called by "TriggerScriptA.vbs", but...
VB Script
Show VBScript error message in windows Form Application
Hi I want to know if possible to show the error message in my program instead of windows script Host messagebox when i run a vbscript from my...
VB Script
VBScript halts with out error message
I have a script that creates and calls a batch file. It runs through 17 commands and then freezes. If I exit the script and run the batch file it...
VB Script
error CDO.Message - VBScript
hi, to see if I can help. I have the following script that until a few days ago it worked correctly. Has not touched any of the settings in...
VB Script
How to remove vbscript text from message box
Hi, I am using the following code to validate the form: <script language="vbscript"> sub window_OnLoad frmvalidate.Username.focus end sub ...
VB Script
Cannot uninstall iTunes: VBscript message
Help Please! I can't uninstall itunes, I'm running on Vista premium. I just bought a new iPod 80GB classic and it wouldn't work on my current...
Software