Ver Mensaje Individual
  #3
Antiguo 20 de noviembre de 2019, 17:45
Joseg
El Foro es mi casa
Activista del Foro: Activista del Foro - Issue reason: Por participación activa Innovación: Por aportar innovaciones - Issue reason: Por aportar soluciones innovadoras en varias ocasiones 
Última Actividad 17.09.2026 18:23
Posts Posts: 401
Likes enviados Enviados: 130
Likes recibidos Recibidos: 179

Eu uso SwithMail:

Código COBOL:
  1.           string "SwithMail.exe /s /x swc.xml" delimited by size
  2.               " /to "  delimited by size                 *> para
  3.                JH-TO delimited by "  "
  4.               into CommandLine
  5.           end-string
  6.  
  7.           IF JH-CC NOT = SPACES
  8.              STRING CommandLine DELIMITED BY "  "        *> CC  
  9.                 " /CC "  delimited by size
  10.                 JH-CC delimited by "  "
  11.                 INTO CommandLine
  12.              end-string
  13.           END-IF
  14.  
  15.           STRING CommandLine DELIMITED BY "  "
  16.               ' /sub "'  delimited by size
  17.               JH-SUBJECT delimited by "     "       *> assunto
  18.               '"' delimited by size
  19.               INTO  CommandLine
  20.           end-string
  21.  
  22.           STRING CommandLine DELIMITED BY "  "
  23.               ' /b '  delimited by size                  *> body
  24.               '"' delimited by size
  25.               JH-BODY delimited by "                   "
  26.               '"' delimited by size
  27.               into CommandLine
  28.           end-string
  29.  
  30.           IF JH-ATTACH NOT = SPACES      
  31.              STRING CommandLine DELIMITED BY "  "
  32.                 ' /a '  delimited by size
  33.                 '"' delimited by size
  34.                 JH-ATTACH  DELIMITED BY "   "       *> anexo1
  35.                 '"' delimited by size
  36.                 INTO CommandLine
  37.              end-string
  38.           END-IF
  39.          
  40.           ---> chamar aqui a CommandLine   (não sei como é em Acucobol)


Usando o Outlook:
Criar um arquivo line sequencial:

Código COBOL:
  1.      move spaces to regsm
  2.      MOVE "Dim o" to regsm
  3.      WRITE regsm
  4. *-----------------------------------------------------------------------------
  5.      move spaces to regsm
  6.      MOVE "Dim m" to regsm
  7.      WRITE regsm
  8. *-----------------------------------------------------------------------------
  9.      move spaces to regsm
  10.      MOVE 'Set o = CreateObject("Outlook.Application")' to regsm
  11.      WRITE regsm
  12. *-----------------------------------------------------------------------------
  13.      move spaces to regsm
  14.      MOVE 'Set m = o.CreateItem(0)' to regsm
  15.      WRITE regsm
  16. *-----------------------------------------------------------------------------
  17.      move spaces to regsm
  18.      STRING "m.to = " DELIMITED BY SIZE
  19.             '"' DELIMITED BY SIZE
  20.             pmail DELIMITED BY ' '      *> EMAIL
  21.             '"' DELIMITED BY SIZE
  22.             INTO regsm
  23.      WRITE regsm
  24. *-----------------------------------------------------------------------------
  25.      move spaces to regsm
  26.      MOVE spaces TO pcc    *> CC
  27.      IF pcc NOT = " "
  28.         STRING "m.Cc = " DELIMITED BY SIZE
  29.             '"' DELIMITED BY SIZE
  30.             pcc DELIMITED BY ' '
  31.             '"' DELIMITED BY SIZE
  32.             INTO regsm
  33.         WRITE regsm
  34.      END-IF
  35. *-----------------------------------------------------------------------------
  36.      move spaces to regsm
  37.      MOVE spaces TO pbcc   *> BCC
  38.      IF pbcc NOT = "  "
  39.         STRING "m.Bcc = " DELIMITED BY SIZE
  40.             '"' DELIMITED BY SIZE
  41.             pbcc DELIMITED BY ' '
  42.             '"' DELIMITED BY SIZE
  43.             INTO regsm
  44.         WRITE regsm
  45.      END-IF
  46. *-----------------------------------------------------------------------------
  47.      move spaces to regsm
  48.         STRING "m.Subject = " DELIMITED BY SIZE
  49.             '"' DELIMITED BY SIZE
  50.             passunto DELIMITED BY '   '      *> assunto
  51.             '"' DELIMITED BY SIZE
  52.             INTO regsm
  53.      WRITE regsm
  54. *-----------------------------------------------------------------------------
  55.      move spaces to regsm
  56.      MOVE "m.Display" to regsm
  57.      WRITE regsm
  58.  
  59. *-----------------------------------------------------------------------------
  60.  
  61.      move spaces to regsm
  62.    
  63.         STRING "m.HTMLBody = " DELIMITED BY SIZE
  64.             '"' DELIMITED BY SIZE
  65.             pbody DELIMITED BY '                 '  *> body
  66.             '" & "<br>" & m.HTMLBody  ' DELIMITED BY SIZE
  67.             INTO regsm
  68.      WRITE regsm
  69. *-----------------------------------------------------------------------------
  70.      move spaces to regsm
  71.     *> Attachments
  72.         STRING "m.Attachments.Add " DELIMITED BY SIZE
  73.             '"' DELIMITED BY SIZE
  74.             pAttachments DELIMITED BY '            '   *> anexos
  75.             '"' DELIMITED BY SIZE
  76.             INTO regsm
  77.      WRITE regsm
  78. *-----------------------------------------------------------------------------
  79.      move spaces to regsm
  80.      MOVE "m.Display" to regsm
  81.      WRITE regsm
  82.  
  83. *-----------------------------------------------------------------------------
  84.      move spaces to regsm
  85.      MOVE "m.Send" TO regsm
  86.       WRITE regsm
Joseg is offline   Responder Con Cita