MAPI: sending email back to originator

Louise Evans

New Member
Hi Everyone,

Does anyone know how I can send an email to the originator/user of the email?

My scenario is that of there is no email address available on the database I want to send the email to the person busy doing the mailout so that they have a record of the email.

I'm using a MAPI session.

Thanks!

Louise
 
Originally posted by Louise Evans
Hi Everyone,

Does anyone know how I can send an email to the originator/user of the email?

My scenario is that of there is no email address available on the database I want to send the email to the person busy doing the mailout so that they have a record of the email.

I'm using a MAPI session.

Thanks!

Louise

Hello,

see code below, walking through the inbox of MS Outlook with mapi.
Code:
[font=Fixedsys][size=1]def var chSession     as com-handle no-undo.
def var chInbox       as com-handle no-undo.
def var chfolder      as com-handle no-undo.   
def var chOnefolder   as com-handle no-undo.
def var chMessage     as com-handle no-undo.
def var chOneMessage  as com-handle no-undo.
Def Var chStoreFolder As Com-handle No-undo.
def var chRecipient   as com-handle no-undo.
def var chAttachment  as com-handle no-undo.[/size][/font]
[font=Fixedsys][size=1]def var logon_name      as char NO-UNDO INIT "MS Exchange-Einstellungen".[/size][/font]
[font=Fixedsys][size=1]create "MAPI.SESSION" chSession.
Repeat on error undo,leave on endkey undo,leave:
    
    /*
    chSession:logoff no-error. 
    chSession:logon (logon_name,"",false,true,0).
    */
    
    chsession:logon().  
    ASSIGN
    chinbox         = chsession:inbox
    chonefolder     = chinbox.
    chmessage       = chonefolder:Messages.
    msg:
    REPEAT On Stop Undo,leave On Error Undo,next On Endkey Undo,Next:
        chOneMessage    = chmessage:getnext no-error.
        if error-status:error or not valid-handle(chOneMessage) THEN LEAVE msg.
        chrecipient =  chOneMessage:Sender.
        Disp chrecipient:name Format "x(30)"  /* From  */ 
             date(chOneMessage:TimeSent)
             Date(chOneMessage:TimeReceived) No-error.
    End.
      
Leave.
end.  /* main */[/size][/font]
[font=Fixedsys][size=1]chSession:logoff no-error.  [/size][/font]
[font=Fixedsys][size=1]release object chAttachment  no-error.
release object chRecipient   no-error.
release object chOneMessage  no-error.
release object chMessage     no-error.
release object chOnefolder   no-error.
release object chStorefolder no-error.
release object chfolder      no-error.
release object chInbox       no-error.
release object chSession     no-error.[/size][/font]
 
Back
Top