Announcement

Collapse
No announcement yet.

HTML Email from Source Code forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTML Email from Source Code forum

    Ken,
    'CDO.INC is not included, just prepare your own from
    'the PB COM Browser
    I've never really done anything with COM before. Could you explain the process to "prepare your own"? What exactly is this .inc file anyway, and is there a reason why it wouldn't be a good idea to post a copy of it as well?


    Thanks. It looks like pretty cool code that I'm sure many (including me!) will get lots of use out of!


    ------------------
    Joe Byrne
    mailto:[email protected]
    [email protected]
    </A>
    Software makes Hardware Happen

  • #2
    joe,

    sorry about that. it really wasn't that long so i went ahead and
    added it to the post in the source code forum.
    http://www.powerbasic.com/support/pb...ad.php?t=24026

    to create the include file you can do the following in pbwin 7.0x
    or pbcc 3.0x:

    1) go to the tools menu and select powerbasic com browser.
    2) file/open a registered library.
    3) scroll through the list of registered libraries looking for "microsoft cdo for nts 1.2 library".
    4) select that and its interface will show in pb's com browser.
    5) i then performed a file/select all interfaces and a file/save interface to clipboard.
    6) i then created a new file in the powerbasic editor and pasted the interface code into the editor.
    7) i then named the file cdo.inc and included it in the main module as usual.

    i have found this to be extremely powerful and am very grateful to powerbasic for incorporating
    this functionality into pbwin7 and pbcc3.

    hope this helps.

    -ken

    ------------------
    Mac Application Reviews and More

    Comment


    • #3
      Other good reasons to use CDO:

      1) It avoids the prompt that comes up saying "An application is
      trying to send an email..." that makes MAPI unusable in some environments.

      2) It allows for images to be embedded easily into your HTML email. You
      can check out the use of AttachURL.

      3) It's much easier than directly dealing with extended MAPI.


      Here is a link to Microsoft info on CDO which covers the system requirements:
      http://msdn.microsoft.com/library/de...ataobjects.asp

      -Ken

      ------------------
      Mac Application Reviews and More

      Comment


      • #4
        Re the CDO.INC removed post and :-

        ' Legal Copyright: Copyright (C) 1986-1999 Microsoft Corp. All rights reserved.
        Removed by Administrator. Please don't post copyrighted code unless you can show
        that it may legally be distributed in public.'

        This could indicate to me that the use of PB's COM browser to generate and use code
        from COM objects, without having first obtained a licence from the COM Object developer,
        might be an infringement of copyright.

        How do we stand on this?

        I still intend to try a generation of CDO.INC at home tonight, as described by Ken.

        Regards

        David



        ------------------

        Comment


        • #5
          Sorry about that everyone.

          PB Admin. thanks for the correction. I remember that this issue
          has been brought up before.

          -Ken

          ------------------
          Mac Application Reviews and More

          Comment


          • #6
            Hey Joe,

            I was unable to get your example to work. I generated the CDO.inc file as per your directions but the example bails out on this line...

            Code:
            object call myMail.Send to vVnt
            With an "Illegal function call"


            Thanks for any help

            ------------------
            Stay where ya from, we'll come where ya to.
            Start as you mean to go on.

            Comment


            • #7
              This could indicate to me that the use of PB's COM browser to generate and use code
              from COM objects, without having first obtained a licence from the COM Object developer,
              might be an infringement of copyright.
              It would be prudent to check the copyright license for the COM object
              in question. You may need a developer's license in order to use an
              object with your program, for example. It's a pity that Microsoft
              didn't supply a "license" field next to the "copyright" field. As it
              stands, finding the license information may be rather a chore. Check
              with the copyright owner.


              ------------------
              Tom Hanlin
              PowerBASIC Staff

              Comment


              • #8
                DIM myMail AS CDONTSNewMail
                I get undefined type using Windows XP Pro.


                ------------------

                Comment


                • #9
                  Mark & Mark

                  I really only tested on a Windows 2000 Pro notebook with virtually
                  every Microsoft development tool loaded. It's possible that I have
                  multiple libraries that some people may not have.

                  However, illegal function call can have several different meanings.
                  I would recommend that you trap the error and go for the more descriptive
                  error message offered in the user's guide and shown in the sample:

                  Code:
                      CALL FormatMessage(%FORMAT_MESSAGE_FROM_SYSTEM, _
                      BYVAL 0&, OBJRESULT, BYVAL MAKELANGID( _
                      %LANG_NEUTRAL, %SUBLANG_DEFAULT), _
                      A, SIZEOF(A), BYVAL 0&)
                      MSGBOX A
                  Are you using the code that was provided or a variant? If it is
                  a variant, feel free to email it to me and I'll see if I can help
                  or post it here.

                  You are also welcome to try a compiled exe which is using CDO
                  and grab the source code (written for VD - Visual Designer for PB).
                  This will help you know if you have everything installed to utilize
                  CDO this way.
                  http://www.zcureit.com/vd/CDOMailer.zip

                  -Ken

                  In case everyone is not aware, VD for PB is available at:
                  http://www.hellobasic.com


                  kmyers at zcureit dot com

                  ------------------


                  [This message has been edited by Ken Myers (edited October 09, 2003).]
                  Mac Application Reviews and More

                  Comment


                  • #10
                    I guess that Mark has not generated all the interfaces. You have to
                    "Select all the interfaces" with Ctrl+A or the menu.


                    ------------------

                    Comment


                    • #11
                      Originally posted by Tom Hanlin:
                      It would be prudent to check the copyright license for the COM object
                      in question. You may need a developer's license in order to use an
                      object with your program, for example. It's a pity that Microsoft
                      didn't supply a "license" field next to the "copyright" field. As it
                      stands, finding the license information may be rather a chore. Check
                      with the copyright owner.
                      As I've been told by our MS rep in the past, no dev license needed to
                      program for it, you just can't redistribute the library. Not sure how
                      exactly that relates to distributing an include file for it though.

                      Microsoft use to allow the redistribution of CDO.DLL, but now there is
                      NO version of CDO that can be redistributed. Note the library used in
                      this thread, CDONTS.DLL, was never redistributable. i.e. you must
                      install IIS 4.0-5.0 (or MCIS or Exhange 5.5 with IMS) for CDONTS. It does
                      not come with IIS 5.1 or up as you are expected to use the improved
                      CDOSYS that comes with W2K and up.

                      For nothing else other than this fact (CDOSYS comes w/ W2K and up), I
                      would switch to using CDOSYS and allow specifying an SMTP server
                      (or chose delivery type).

                      I replied to the thread in the Source Code forum (different info) before
                      I remembered how you guys did things here (code in Source Code and talk
                      about it here), and they made more sense as replies there too I guess.
                      Anyway sorry for posting in the wrong place.

                      Gerald W. Gaston


                      [This message has been edited by Gerald W. Gaston (edited October 12, 2003).]

                      Comment


                      • #12
                        Originally posted by Mark Dotson:
                        DIM myMail AS CDONTSNewMail
                        I get undefined type using Windows XP Pro.
                        CDONTS didn't ship with XP (or 2003 Server). Use CDOSYS instead.

                        Gerald W. Gaston

                        Comment


                        • #13
                          Originally posted by Ken Myers:
                          Other good reasons to use CDO:

                          1) It avoids the prompt that comes up saying "An application is
                          trying to send an email..." that makes MAPI unusable in some environments.
                          This is true of CDONTS and other non-MAPI based CDO libraries (like CDOSYS),
                          but it is not true of all CDO (i.e. updated version of CDO.DLL).

                          Your program using CDONTS works for you because you have IIS SMTP running
                          and setup to deliver/relay your mail.

                          Gerald W. Gaston

                          Comment


                          • #14
                            Thanks for the clarification. Sure didn't mean to kick up a big
                            storm, just found something that works extremely well for me and
                            wanted to share it with the group.

                            Anyway, I'll most likely try to limit the COM examples due to
                            licensing and other issues.

                            -Ken

                            ------------------
                            Mac Application Reviews and More

                            Comment


                            • #15
                              Do what I do. Use late binding in your examples. This way, you don't
                              need to post the interfaces.


                              ------------------

                              Comment

                              Working...
                              X