Eu uso SwithMail:
COBOL Código:
string "SwithMail.exe /s /x swc.xml" delimited by size
" /to " delimited by size *> para
JH-TO delimited by " "
into CommandLine
end-string
IF JH-CC NOT = SPACES
STRING CommandLine DELIMITED BY " " *> CC
" /CC " delimited by size
JH-CC delimited by " "
INTO CommandLine
end-string
END-IF
STRING CommandLine DELIMITED BY " "
' /sub "' delimited by size
JH-SUBJECT delimited by " " *> assunto
'"' delimited by size
INTO CommandLine
end-string
STRING CommandLine DELIMITED BY " "
' /b ' delimited by size *> body
'"' delimited by size
JH-BODY delimited by " "
'"' delimited by size
into CommandLine
end-string
IF JH-ATTACH NOT = SPACES
STRING CommandLine DELIMITED BY " "
' /a ' delimited by size
'"' delimited by size
JH-ATTACH DELIMITED BY " " *> anexo1
'"' delimited by size
INTO CommandLine
end-string
END-IF
---> chamar aqui a CommandLine (não sei como é em Acucobol)
Usando o Outlook:
Criar um arquivo line sequencial:
COBOL Código:
move spaces to regsm
MOVE "Dim o" to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE "Dim m" to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE 'Set o = CreateObject("Outlook.Application")' to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE 'Set m = o.CreateItem(0)' to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
STRING "m.to = " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
pmail DELIMITED BY ' ' *> EMAIL
'"' DELIMITED BY SIZE
INTO regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE spaces TO pcc *> CC
IF pcc NOT = " "
STRING "m.Cc = " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
pcc DELIMITED BY ' '
'"' DELIMITED BY SIZE
INTO regsm
WRITE regsm
END-IF
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE spaces TO pbcc *> BCC
IF pbcc NOT = " "
STRING "m.Bcc = " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
pbcc DELIMITED BY ' '
'"' DELIMITED BY SIZE
INTO regsm
WRITE regsm
END-IF
*-----------------------------------------------------------------------------
move spaces to regsm
STRING "m.Subject = " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
passunto DELIMITED BY ' ' *> assunto
'"' DELIMITED BY SIZE
INTO regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE "m.Display" to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
STRING "m.HTMLBody = " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
pbody DELIMITED BY ' ' *> body
'" & "<br>" & m.HTMLBody ' DELIMITED BY SIZE
INTO regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
*> Attachments
STRING "m.Attachments.Add " DELIMITED BY SIZE
'"' DELIMITED BY SIZE
pAttachments DELIMITED BY ' ' *> anexos
'"' DELIMITED BY SIZE
INTO regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE "m.Display" to regsm
WRITE regsm
*-----------------------------------------------------------------------------
move spaces to regsm
MOVE "m.Send" TO regsm
WRITE regsm
Marcadores