Windows Vista Forums

RE: CDO.Message What am I doing wrong?
  1. #1


    RichS Guest

    RE: CDO.Message What am I doing wrong?

    What actually happens when you run the code? Do you get an error message?
    --
    Richard Siddaway
    Please note that all scripts are supplied "as is" and with no warranty
    Blog: http://richardsiddaway.spaces.live.com/
    PowerShell User Group: http://www.get-psuguk.org.uk




    "Peter" wrote:

    > Hi Everyone,
    >
    > What's wrong wtih my code? I ported this from my VBScript.
    >
    > $msg = new-Object -comobject "CDO.Message";
    >
    > $msg.From = "me@email.com";
    > $msg.To = "me@email.com";
    > $msg.Subject = "This is a test subject.";
    > $msg.TextBody = "This is a test body.";
    >
    > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ;
    > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.server.com";
    > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ;
    > $msg.Send;
    >
    > I'm a long-time VBScript coder since I am a Windows Administrator at a bank.
    > Since Powershell came out, I've been doing my darndest to learn it as well
    > as VBScript, but this last one has me pulling my hair out.
    >
    > By the way, I love the string-parsing capabilities of Powershell. AWESOME!


      My System SpecsSystem Spec

  2. #2


    Peter Guest

    RE: CDO.Message What am I doing wrong?

    PS H:\> &"C:\Documents and Settings\bla\Desktop\Email.ps1"


    MemberType : Method
    OverloadDefinitions : {void Send ()}
    TypeNameOfValue : System.Management.Automation.PSMethod
    Value : void Send ()
    Name : Send
    IsInstance : True

    that's all it says... it doesn't actually send an email.


    "RichS" wrote:

    > What actually happens when you run the code? Do you get an error message?
    > --
    > Richard Siddaway
    > Please note that all scripts are supplied "as is" and with no warranty
    > Blog: http://richardsiddaway.spaces.live.com/
    > PowerShell User Group: http://www.get-psuguk.org.uk
    >
    >
    > "Peter" wrote:
    >
    > > Hi Everyone,
    > >
    > > What's wrong wtih my code? I ported this from my VBScript.
    > >
    > > $msg = new-Object -comobject "CDO.Message";
    > >
    > > $msg.From = "me@email.com";
    > > $msg.To = "me@email.com";
    > > $msg.Subject = "This is a test subject.";
    > > $msg.TextBody = "This is a test body.";
    > >
    > > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ;
    > > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.server.com";
    > > $msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ;
    > > $msg.Send;
    > >
    > > I'm a long-time VBScript coder since I am a Windows Administrator at a bank.
    > > Since Powershell came out, I've been doing my darndest to learn it as well
    > > as VBScript, but this last one has me pulling my hair out.
    > >
    > > By the way, I love the string-parsing capabilities of Powershell. AWESOME!


      My System SpecsSystem Spec

RE: CDO.Message What am I doing wrong? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong message displayed Marlon Medina Live Mail 1 27 Feb 2010
Wrong Message is displayed! daSpookster Vista mail 2 06 May 2008
Opening the wrong message bartleph Vista mail 3 19 Nov 2007
CDO.Message What am I doing wrong? Peter PowerShell 3 28 Mar 2007
Wrong error message Gerhard Vista account administration 1 18 Jun 2006