Sending Mail from MF/NetExpress Object COBOL using MAPI services 
Author Message
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Hi,
I am having a problem invoking a MS Outlook session from my OO Cobol
program(MicroFocus NetExpress 4.0) that uses MSMAPI.MAPISession
registered class and establishes a new outlook session.

The code looks like this:

Class-Control.
   MAPISession         is class "$OLE$MSMAPI.MAPISession"
   MAPIMessages        is class "$OLE$MSMAPI.MAPIMessages"
   CharacterArray      is class "chararry"
Working-Storage Section.
01 SessionObj               object reference.
01 MessageObj               object reference.
Procedure Division.
    invoke MapiSession  "new" returning SessionObj
    invoke MapiMessages "new" returning MessageObj
    invoke SessionObj "SignOn"
    invoke SessionObj "GetSessionID" returning plSessionID

This program is a called program from a WEB CGI program running on an MS
IIS Web Server, Windows 2000 professional environment.

The eroor I get is as follows:

Exception 65537 not trapped by the class oleexceptionmanager.
Description: "Server defined OLE exception"
(80020009): MAPI Failure: valid session ID does not exist
Hit T to terminate program. Hit any other key to continue.

Exception 65537 not trapped by the class oleexceptionmanager.
Description: "Server defined OLE exception"
(80020009): Property is read only when not using compose buffer. Set
            MsgIndex = -1

I suspect there is a security issue here, but I am not sure. I have
checked that the IIS_User has security acces to send mail, but no
luck so far.

Any ideas?

thanks

R...

--
Posted via http://www.*-*-*.com/



Mon, 26 Dec 2005 07:52:25 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services
Hi,

Do you want the Outlook session for the calendar, notes, etc, or are you
using it simply to send mail, because it is a convenient
MAPI client?

The reason I ask is because there are MUCH better ways to send mail from the
environment you are using than going via Outlook (or ANY MAPI client...)

If you are interested in a (simpler) and more efficient alternative check
out:

http://groups.google.co.nz/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3e...

In the meantime, I have made some suggested changes to your code.

Let me know how you get on.

Pete.


Quote:

> Hi,
> I am having a problem invoking a MS Outlook session from my OO Cobol
> program(MicroFocus NetExpress 4.0) that uses MSMAPI.MAPISession
> registered class and establishes a new outlook session.

> The code looks like this:

> Class-Control.
>    MAPISession         is class "$OLE$MSMAPI.MAPISession"
>    MAPIMessages        is class "$OLE$MSMAPI.MAPIMessages"

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Comment this  Class out.

Quote:
>    CharacterArray      is class "chararry"
> Working-Storage Section.
> 01 SessionObj               object reference.
> 01 MessageObj               object reference.
> Procedure Division.
>     invoke MapiSession  "new" returning SessionObj

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Get to the "Message" by invoking it from the Session hierarchy, like this...

       invoke SessionObj "new" returning MessageObj

Quote:
>     invoke SessionObj "SignOn" ^^^^^^^^^^^^^^^^ won't you need parameters
for this?
>     invoke SessionObj "GetSessionID" returning plSessionID

Animate the above and check that you don't have NULL object references after
the invokes...of the "new" method.

<snip>.

Pete.



Mon, 26 Dec 2005 18:09:47 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Originally posted by Peter E.C. Dashwood

Quote:
> Hi,

> Do you want the Outlook session for the calendar, notes, etc,
> or are you
> using it simply to send mail, because it is a convenient
> MAPI client?

> The reason I ask is because there are MUCH better ways to send mail
> from the
> environment you are using than going via Outlook (or ANY MAPI
> client...)

> If you are interested in a (simpler) and more efficient
> alternative check
> out:

> http://groups.google.co.nz/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&s-
> elm=3edd3a97_3%40news.athenanews.com&rnum=1"]http://groups.google.co.-
> nz/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3edd3a97_3%40news.athenane-
> ws.com&rnum=1[/url]

> In the meantime, I have made some suggested changes to your code.

> Let me know how you get on.

> Pete.



> bforums.com[/url]...

> > Hi,
> > I am having a problem invoking a MS Outlook session from my OO
>     Cobol
> > program(MicroFocus NetExpress 4.0) that uses
>     MSMAPI.MAPISession
> > registered class and establishes a new outlook session.
> > The code looks like this:
> > Class-Control.
> >    MAPISession         is class "$OLE$MSMAPI.MAPISession"
> >    MAPIMessages        is class "$OLE$MSMAPI.MAPIMessages"
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Comment this  Class out.

> >    CharacterArray      is class "chararry"
> > Working-Storage Section.
> > 01 SessionObj               object reference.
> > 01 MessageObj               object reference.
> > Procedure Division.
> >     invoke MapiSession  "new" returning SessionObj
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Get to the "Message" by invoking it from the Session hierarchy,
> like this...

>        invoke SessionObj "new" returning MessageObj

> >     invoke SessionObj "SignOn" ^^^^^^^^^^^^^^^^ won't you need
>     parameters
> for this?
> >     invoke SessionObj "GetSessionID" returning plSessionID

> Animate the above and check that you don't have NULL object
> references after
> the invokes...of the "new" method.

> .

> Pete.

Hi Pete,
I am simply trying to send mail, nothing fancy. It works when I run it
on my locat NetExpress IDE 4.0. But when I move the code to the server
that uses MF Application server(Run Time), it does not work.

Do you have sample code for the mail method you mentioned?  I am
assuming it is cobol call to .NET, is that right?

thanks

R.

--
Posted via http://dbforums.com



Mon, 26 Dec 2005 21:12:50 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services


<snip of my original post>>

Quote:

> Hi Pete,
> I am simply trying to send mail, nothing fancy. It works when I run it
> on my locat NetExpress IDE 4.0. But when I move the code to the server
> that uses MF Application server(Run Time), it does not work.

Did you try the amendments I suggested? There are different Classes in
different environments.

Quote:
> Do you have sample code for the mail method you mentioned?  I am
> assuming it is cobol call to .NET, is that right?

No, it has nothing to do with .NET (although the .NET SMTPMail Class wraps
it...)

It is a use of Collaboration Data Objects (CDOSYS) which has now replaced
CDONTS, as CDO for NTS was called.

Here's the code...(It is Fujitsu OO COBOL but you will be able to translate
to MF pretty easily...)
(paste all the constant data (things starting with 'http://') lines exactly
as below)

* CDOSYS stuff...
 01  COMProgid   pic x(20) value "CDO.Message.1".
 01  objMail      OBJECT REFERENCE CDOSYS.
 01  COMProg02   pic x(20) value "CDO.Configuration.1".
 01  objCDOConf   OBJECT REFERENCE CDOSYS.
 01  objCDOFields    OBJECT REFERENCE CDOSYS.
 01  txtConfItem1  pic x(80) value
     'http://schemas.microsoft.com/cdo/configuration/sendusing'.
 01  txtConfItem2  pic x(80) value
     'http://schemas.microsoft.com/cdo/configuration/smtpserver'.
 01  txtConfItem3  pic x(80) value
     'http://schemas.microsoft.com/cdo/configuration/smtpserverport'.
 01  txtConfItem4  pic x(80) value
     'http://schemas.microsoft.com/cdo/configuration/sendusing'.

 01  txtSubject  pic x(50) value 'Earth, we have a problem...'.


 01  txtTextBody pic x(75) value
     'There is a meltdown in the core on level 37... Thank you for using
Starfleet.'. *> only if you don't

*> have one you prepared

*> earlier...

 01  HTMLMessage pic x(75) value 'Server relative path to the HTML
message\Mess.htm'.
 01  TEXTMessage pic x(75) value 'Server relative path to the TEXT
message\Mess.txt'.
 01  HTML-flag   pic x value space.
     88 sending-HTML value '1'.
     88 sending-TEXT value '0'.

The above caters for an embedded text message, an attached text message, or
an embedded HTML message. There is a problem with embedding images (like
logos, for example) into HTML mail and many people use a link back to their
server for the <img> tag. Obviously, this means the image will only appear
if the mail is read on-line... not a very useful state of affairs...

The code below uses CDOSYS to solve this problem and the result is
elegant.(Logos are embedded into the (HTML) mail and appear whether it is
read offline or not...)

This is using port 25 directly and therefore does not require a MAPI client.
Mail is sent whether the system has Outlook on it or not...

I have previously created a full letter (it is a Booking Confirmation and
has a lot of data in it),  in text or HTML format, depending on what the
user indicated on the Web Page. (Radio Button handled with JavaScript)

*------------------------------------------------------------------------
 Post-the-Mail   section.
 ptm000.
*
*  This section uses CDOSYS to post the mail created by Mail-WBR45CGI
*  above.
*
*  The HTML mail is sent as Body Text with no attachment.
*  Text Mail is sent with a short Message and the Confirmation
*  as a Plain Text Attachment. This is because there is no CDOSYS
*  Plain Text equivalent Method for "CreateMHTMLBody".
*
     move zero to 0-RESULT
     invoke CDOSYS "CREATE-OBJECT"
            using COMProgID
        returning objMail
     end-invoke
     invoke objMail "GET-Configuration"
            returning objCDOConf
     invoke objMail "SET-Subject"
            using  txtSubject
     end-invoke
     invoke objMail "SET-Sender"
            using  txtSender
     end-invoke
     move Email  to txtTo
     invoke objMail "SET-To"
            using  txtTo
     end-invoke
*>
*> these paths are built dynamically...replace them with your own paths to
the HTML or TEXT mail you want to send...
*>
     move 'file://C|/Inetpub/wwwroot/Scripts/WBRMailConfirms/' to
HTMLMessage
     move 'C:\Inetpub\wwwroot\Scripts\WBRMailConfirms\' to TEXTMessage

     if sending-HTML
        string
             HTMLMessage
                delimited by space
             TranID
                delimited by size
             'MailConf.htm'
                delimited by size
                   into HTMLMessage
        end-string
        invoke objMail "CreateMHTMLBody"
               using HTMLMessage
        end-invoke
     else
        string
           TEXTMessage
              delimited by space
           TranID
              delimited by size
           'MailConf.txt'
                delimited by size
                  into TEXTMessage
        end-string
        invoke objMail "AddAttachment"
               using  TEXTMessage
        end-invoke
        invoke objMail "SET-TextBody"
               using  txtTextBody
        end-invoke
     end-if
*
*  Because we are sending from a server it is necessary to configure
*  the CDO system.
*
*'==This section provides the configuration information for the remote SMTP
server.
*'==Normally you will only change the server name or IP.
*Set "sendusing"...
     move 2 to numValue
     invoke objCDOConf "SET-Fields"
            using txtConfItem1
                  numValue
     end-invoke
* Set ServerName...or IP address
     move 'localhost' to txtValue
     invoke objCDOConf "SET-Fields"
            using txtConfItem2
                  txtValue
     end-invoke
* Set Server Port (typically 25)
     move 25 to numValue
     invoke objCDOConf "SET-Fields"
            using txtConfItem3
                  numValue
     end-invoke
     invoke objCDOConf "GET-Fields"
            returning objCDOFields
     end-invoke
* Now use the "update" method to update the configuration fields
     invoke objCDOFields "Update"
     end-invoke

     invoke objMail "Send"
     end-invoke

* clean up...
     set objMail to NULL
     set objCDOConf to NULL
     set objCDOFields to NULL
     .
 ptm999.
     exit.
*------------------------------------------------------------------------

There are a number of methods available with CDO, some of which are not
shown here. Run a search on GOOGLE...

Pete.



Tue, 27 Dec 2005 19:27:15 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services
One (big?) Caveat - CDO is not installed by default and requires an MS
Exchange server (according to MS but I know Pete tested using an
alternate server).

Nothing further.  Go pet your pangolins.


Quote:


> <snip of my original post>>

> > Hi Pete,
> > I am simply trying to send mail, nothing fancy. It works when I run it
> > on my locat NetExpress IDE 4.0. But when I move the code to the server
> > that uses MF Application server(Run Time), it does not work.

> Did you try the amendments I suggested? There are different Classes in
> different environments.

> > Do you have sample code for the mail method you mentioned?  I am
> > assuming it is cobol call to .NET, is that right?

> No, it has nothing to do with .NET (although the .NET SMTPMail Class wraps
> it...)

> It is a use of Collaboration Data Objects (CDOSYS) which has now replaced
> CDONTS, as CDO for NTS was called.

> Here's the code...(It is Fujitsu OO COBOL but you will be able to translate
> to MF pretty easily...)
> (paste all the constant data (things starting with 'http://') lines exactly
> as below)

> * CDOSYS stuff...
>  01  COMProgid   pic x(20) value "CDO.Message.1".
>  01  objMail      OBJECT REFERENCE CDOSYS.
>  01  COMProg02   pic x(20) value "CDO.Configuration.1".
>  01  objCDOConf   OBJECT REFERENCE CDOSYS.
>  01  objCDOFields    OBJECT REFERENCE CDOSYS.
>  01  txtConfItem1  pic x(80) value
>      'http://schemas.microsoft.com/cdo/configuration/sendusing'.
>  01  txtConfItem2  pic x(80) value
>      'http://schemas.microsoft.com/cdo/configuration/smtpserver'.
>  01  txtConfItem3  pic x(80) value
>      'http://schemas.microsoft.com/cdo/configuration/smtpserverport'.
>  01  txtConfItem4  pic x(80) value
>      'http://schemas.microsoft.com/cdo/configuration/sendusing'.

>  01  txtSubject  pic x(50) value 'Earth, we have a problem...'.


>  01  txtTextBody pic x(75) value
>      'There is a meltdown in the core on level 37... Thank you for using
> Starfleet.'. *> only if you don't

> *> have one you prepared

> *> earlier...

>  01  HTMLMessage pic x(75) value 'Server relative path to the HTML
> message\Mess.htm'.
>  01  TEXTMessage pic x(75) value 'Server relative path to the TEXT
> message\Mess.txt'.
>  01  HTML-flag   pic x value space.
>      88 sending-HTML value '1'.
>      88 sending-TEXT value '0'.

> The above caters for an embedded text message, an attached text message, or
> an embedded HTML message. There is a problem with embedding images (like
> logos, for example) into HTML mail and many people use a link back to their
> server for the <img> tag. Obviously, this means the image will only appear
> if the mail is read on-line... not a very useful state of affairs...

> The code below uses CDOSYS to solve this problem and the result is
> elegant.(Logos are embedded into the (HTML) mail and appear whether it is
> read offline or not...)

> This is using port 25 directly and therefore does not require a MAPI client.
> Mail is sent whether the system has Outlook on it or not...

> I have previously created a full letter (it is a Booking Confirmation and
> has a lot of data in it),  in text or HTML format, depending on what the
> user indicated on the Web Page. (Radio Button handled with JavaScript)

> *------------------------------------------------------------------------
>  Post-the-Mail   section.
>  ptm000.
> *
> *  This section uses CDOSYS to post the mail created by Mail-WBR45CGI
> *  above.
> *
> *  The HTML mail is sent as Body Text with no attachment.
> *  Text Mail is sent with a short Message and the Confirmation
> *  as a Plain Text Attachment. This is because there is no CDOSYS
> *  Plain Text equivalent Method for "CreateMHTMLBody".
> *
>      move zero to 0-RESULT
>      invoke CDOSYS "CREATE-OBJECT"
>             using COMProgID
>         returning objMail
>      end-invoke
>      invoke objMail "GET-Configuration"
>             returning objCDOConf
>      invoke objMail "SET-Subject"
>             using  txtSubject
>      end-invoke
>      invoke objMail "SET-Sender"
>             using  txtSender
>      end-invoke
>      move Email  to txtTo
>      invoke objMail "SET-To"
>             using  txtTo
>      end-invoke
> *>
> *> these paths are built dynamically...replace them with your own paths to
> the HTML or TEXT mail you want to send...
> *>
>      move 'file://C|/Inetpub/wwwroot/Scripts/WBRMailConfirms/' to
> HTMLMessage
>      move 'C:\Inetpub\wwwroot\Scripts\WBRMailConfirms\' to TEXTMessage

>      if sending-HTML
>         string
>              HTMLMessage
>                 delimited by space
>              TranID
>                 delimited by size
>              'MailConf.htm'
>                 delimited by size
>                    into HTMLMessage
>         end-string
>         invoke objMail "CreateMHTMLBody"
>                using HTMLMessage
>         end-invoke
>      else
>         string
>            TEXTMessage
>               delimited by space
>            TranID
>               delimited by size
>            'MailConf.txt'
>                 delimited by size
>                   into TEXTMessage
>         end-string
>         invoke objMail "AddAttachment"
>                using  TEXTMessage
>         end-invoke
>         invoke objMail "SET-TextBody"
>                using  txtTextBody
>         end-invoke
>      end-if
> *
> *  Because we are sending from a server it is necessary to configure
> *  the CDO system.
> *
> *'==This section provides the configuration information for the remote SMTP
> server.
> *'==Normally you will only change the server name or IP.
> *Set "sendusing"...
>      move 2 to numValue
>      invoke objCDOConf "SET-Fields"
>             using txtConfItem1
>                   numValue
>      end-invoke
> * Set ServerName...or IP address
>      move 'localhost' to txtValue
>      invoke objCDOConf "SET-Fields"
>             using txtConfItem2
>                   txtValue
>      end-invoke
> * Set Server Port (typically 25)
>      move 25 to numValue
>      invoke objCDOConf "SET-Fields"
>             using txtConfItem3
>                   numValue
>      end-invoke
>      invoke objCDOConf "GET-Fields"
>             returning objCDOFields
>      end-invoke
> * Now use the "update" method to update the configuration fields
>      invoke objCDOFields "Update"
>      end-invoke

>      invoke objMail "Send"
>      end-invoke

> * clean up...
>      set objMail to NULL
>      set objCDOConf to NULL
>      set objCDOFields to NULL
>      .
>  ptm999.
>      exit.
> *------------------------------------------------------------------------

> There are a number of methods available with CDO, some of which are not
> shown here. Run a search on GOOGLE...

> Pete.



Wed, 28 Dec 2005 11:37:38 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services


Quote:
> One (big?) Caveat - CDO is not installed by default and requires an MS
> Exchange server (according to MS but I know Pete tested using an
> alternate server).

> Nothing further.  Go pet your pangolins.

My understanding, based on MS documents is that it is NOT installed by
default with NTServer.  It came with XP and i understand it does with Win 2K
also. I have seen conflicting statements as to the requirement for an
exchange server.

I guess the best course is simply to try it and see...

Pete.

<snipped code sample before Richard can s{*filter*} at it...<G>>



Wed, 28 Dec 2005 15:39:46 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services
Hi R..,

I would guess permissions as well. For MAPI to work you usually needs to go
in and setup the Mail profiles using the mail applet in control panel. You
can configure to set the default profile and setup authentication so that
you are not prompted for a userid/password.

However use IUSR_machinename I don't know how you can setup the profiles
correctly so in your case it may not have a profile to use.

I would try amending the user account that IIS runs the CGI under to be one
that you know MAPI is working correctly from.

You can do this by amending the anonymous access account under Directory
Security tab on the Virtual Directory properties.

Rgds
David.


Quote:

> Hi,
> I am having a problem invoking a MS Outlook session from my OO Cobol
> program(MicroFocus NetExpress 4.0) that uses MSMAPI.MAPISession
> registered class and establishes a new outlook session.

> The code looks like this:

> Class-Control.
>    MAPISession         is class "$OLE$MSMAPI.MAPISession"
>    MAPIMessages        is class "$OLE$MSMAPI.MAPIMessages"
>    CharacterArray      is class "chararry"
> Working-Storage Section.
> 01 SessionObj               object reference.
> 01 MessageObj               object reference.
> Procedure Division.
>     invoke MapiSession  "new" returning SessionObj
>     invoke MapiMessages "new" returning MessageObj
>     invoke SessionObj "SignOn"
>     invoke SessionObj "GetSessionID" returning plSessionID

> This program is a called program from a WEB CGI program running on an MS
> IIS Web Server, Windows 2000 professional environment.

> The eroor I get is as follows:

> Exception 65537 not trapped by the class oleexceptionmanager.
> Description: "Server defined OLE exception"
> (80020009): MAPI Failure: valid session ID does not exist
> Hit T to terminate program. Hit any other key to continue.

> Exception 65537 not trapped by the class oleexceptionmanager.
> Description: "Server defined OLE exception"
> (80020009): Property is read only when not using compose buffer. Set
>             MsgIndex = -1

> I suspect there is a security issue here, but I am not sure. I have
> checked that the IIS_User has security acces to send mail, but no
> luck so far.

> Any ideas?

> thanks

> R...

> --
> Posted via http://dbforums.com



Wed, 28 Dec 2005 16:40:10 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services
Ringo,
Don't know if this helps but I generate this vb script with a cobol program
and and then do a system call to run the script. The program makes  from 1
to 700 emails and just launches the scripts.
These lines are just working storage items that I modify.

Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail

MessageSubject = "Special Announcement"
MessageBody = "Here are your leads for  07-08-2003"
MessageAttachment = "Y:\filder\folder\somefile.txt"
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf
newMail.RecipIents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment)
newMail.Send



Quote:

> Hi,
> I am having a problem invoking a MS Outlook session from my OO Cobol
> program(MicroFocus NetExpress 4.0) that uses MSMAPI.MAPISession
> registered class and establishes a new outlook session.

> The code looks like this:

> Class-Control.
>    MAPISession         is class "$OLE$MSMAPI.MAPISession"
>    MAPIMessages        is class "$OLE$MSMAPI.MAPIMessages"
>    CharacterArray      is class "chararry"
> Working-Storage Section.
> 01 SessionObj               object reference.
> 01 MessageObj               object reference.
> Procedure Division.
>     invoke MapiSession  "new" returning SessionObj
>     invoke MapiMessages "new" returning MessageObj
>     invoke SessionObj "SignOn"
>     invoke SessionObj "GetSessionID" returning plSessionID

> This program is a called program from a WEB CGI program running on an MS
> IIS Web Server, Windows 2000 professional environment.

> The eroor I get is as follows:

> Exception 65537 not trapped by the class oleexceptionmanager.
> Description: "Server defined OLE exception"
> (80020009): MAPI Failure: valid session ID does not exist
> Hit T to terminate program. Hit any other key to continue.

> Exception 65537 not trapped by the class oleexceptionmanager.
> Description: "Server defined OLE exception"
> (80020009): Property is read only when not using compose buffer. Set
>             MsgIndex = -1

> I suspect there is a security issue here, but I am not sure. I have
> checked that the IIS_User has security acces to send mail, but no
> luck so far.

> Any ideas?

> thanks

> R...

> --
> Posted via http://dbforums.com



Wed, 28 Dec 2005 20:58:02 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Not trying to offend, but I couldn't help the Fujitsu .NET COBOL
solution for sending an email:

 IDENTIFICATION DIVISION.
 PROGRAM-ID. EMAIL2.
 ENVIRONMENT DIVISION.
 CONFIGURATION SECTION.
 REPOSITORY.
     CLASS SmtpMail AS "System.Web.Mail.SmtpMail".
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 PROCEDURE DIVISION.


                           "This is from COBOL - Test"
                           "This is a test Email from a COBOL program".

....that's it. Sends an email just fine. Why should it be any more
complicated? And any or all of the 4 literal strings may be data items
as well....
<grin>
-Howard

--
Posted via http://dbforums.com



Fri, 30 Dec 2005 01:23:18 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Quote:

> Not trying to offend, but I couldn't help the Fujitsu .NET COBOL
> solution for sending an email:

>  IDENTIFICATION DIVISION.
>  PROGRAM-ID. EMAIL2.
>  ENVIRONMENT DIVISION.
>  CONFIGURATION SECTION.
>  REPOSITORY.
>      CLASS SmtpMail AS "System.Web.Mail.SmtpMail".
>  DATA DIVISION.
>  WORKING-STORAGE SECTION.
>  PROCEDURE DIVISION.


>                            "This is from COBOL - Test"
>                            "This is a test Email from a COBOL program".

> ....that's it. Sends an email just fine. Why should it be any more
> complicated? And any or all of the 4 literal strings may be data items
> as well....
> <grin>
> -Howard

Now try that in Fujitsu Net Cobol v 7

:-))



Fri, 30 Dec 2005 01:34:19 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Quote:

> Now try that in Fujitsu Net Cobol v 7

> :-))

...and then try moving it back to the .NET compiler...

Gary.



Fri, 30 Dec 2005 12:13:13 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Thanks everyone for the wonderful suggestions.

Pete, thanks for your code change suggestions. I tried it works on my
local NetExpress IDE 4.0 , but not on the server.

I truly believe it is a security issue, but I will try all the
suggestions I got from everybody and will keep you posted.

The idea about the VB code is an excellent idea too. I even thought of
creating a class for sending mail using JAVA and then calling it from
COBOL.  Similar to calling the VB, as it was suggested.

Let me experiment, and wiil let you all know.......

Thanks again for all the suggestions....

R...............

--
Posted via http://dbforums.com



Fri, 30 Dec 2005 23:48:01 GMT  
 Sending Mail from MF/NetExpress Object COBOL using MAPI services

Originally posted by hhinman

Quote:
> Not trying to offend, but I couldn't help the Fujitsu .NET COBOL
> solution for sending an email:

>  IDENTIFICATION DIVISION.
>  PROGRAM-ID. EMAIL2.
>  ENVIRONMENT DIVISION.
>  CONFIGURATION SECTION.
>  REPOSITORY.
>      CLASS SmtpMail AS "System.Web.Mail.SmtpMail".
>  DATA DIVISION.
>  WORKING-STORAGE SECTION.
>  PROCEDURE DIVISION.


>                            "This is from COBOL - Test"
>                            "This is a test Email from a COBOL
>                            program".

> .....that's it. Sends an email just fine. Why should it be any more
> complicated? And any or all of the 4 literal strings may be data items
> as well....
> <grin>
> -Howard

Howard,
I am curious, do you need a licence to access System.Web.Mail.SmtpMail?
If yes, what product or products this is tied to? I assume you need an
entry in the registry before you could call this class.
I tried your code but because I don't have the System.Web.Mail.SmtpMail
defined anywhere in my environment, it didn't work.
Maybe you could give me some hints as to how this code workd.

thanks

R....

--
Posted via http://dbforums.com



Sat, 31 Dec 2005 05:27:50 GMT  
 
 [ 23 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Sending e-mail using MAPI

2. Sending e-mail from COBOL NetExpress

3. send mail using SMTP Send Message when mail server is unknown

4. Problems using MAPI to access Notes mail database

5. MF Cobol + Web (Netexpress 3.1)

6. Printing from MF NetExpress COBOL

7. Cerco utenti MF Cobol e NetExpress

8. MF NetExpress and Personal Cobol on Same NT 4.0 System

9. Caller Line Identification /NetExpress/MF Cobol Under Unix

10. MF-NetExpress COBOL Applications and serial ports

11. MF COBOL Newsgroup?? Especially for NetExpress and Workbench

12. Fujitsu 4.0 vs MF NetExpress & MF Resolve

 

 
Powered by phpBB® Forum Software