Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
96 Views

E_mail

Thanks to Paul Curtis for his answer

I have not been able to make it work so far

where can I find the sources of GLOBALS, MAPITY, CONTWRAP, TRACEDIAG and FILESUBS that are used in MAPI ?

Thnaks in advance

0 Kudos
5 Replies
Highlighted
Valued Contributor I
96 Views

Just noticed this post.  MAPITY is a collection of MAPI constants and data types, you will definitely need that, but not much else.

MODULE mapity
    USE ifwinty
    IMPLICIT NONE
    SAVE

    !INTEGER, PARAMETER  :: LPULONG   = 4
    !INTEGER, PARAMETER  :: LPSTR     = 4
    !INTEGER, PARAMETER  :: LPBYTE    = 4
    !INTEGER, PARAMETER  :: LPVOID    = 4
    !INTEGER, PARAMETER  :: LPLHANDLE = 4

    INTEGER, PARAMETER  :: lhSessionNull = 0
    
!    TYPE T_MapiInit_0
!        INTEGER ulversion
!        INTEGER ulFlags
!    END TYPE T_MapiInit_0
    
    INTEGER, PARAMETER  :: MAPI_INIT_VERSION = 0

!    TYPE T_MapiFileDesc
!        INTEGER ulReserved            ! Reserved for future USE (must be 0)     
!        INTEGER flFlags               ! INTEGER                                   
!        INTEGER nPosition             ! CHARACTER in text to be replaced by attachment 
!        INTEGER(LPSTR) lpszPathName   ! Full path name of attachment file       
!        INTEGER(LPSTR) lpszFileName   ! Original file name (optional)           
!        INTEGER(LPVOID) lpFileTYPE    ! Attachment file TYPE (can be lpMapiFileTagExt) 
!    END TYPE T_MapiFileDesc

    INTEGER, PARAMETER :: MAPI_OLE                =#00000001
    INTEGER, PARAMETER :: MAPI_OLE_STATIC         =#00000002


!    TYPE T_MapiFileTagExt
!        INTEGER ulReserved           ! Reserved, must be zero.                  
!        INTEGER cbTag                ! Size (in INTEGER(1)s) of                       
!        INTEGER(LPBYTE) lpTag        ! X.400 OID for this attachment TYPE       
!        INTEGER cbEncoding           ! Size (in INTEGER(1)s) of                       
!        INTEGER(LPBYTE) lpEncoding   ! X.400 OID for this attachment's encoding 
!    END TYPE T_MapiFileTagExt


    TYPE T_MapiRecipDesc
        INTEGER ulReserved           ! Reserved for future USE                 
        INTEGER ulRecipClass         ! Recipient class                          
                                     ! MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG    
        INTEGER(LPSTR) lpszName      ! Recipient name                           
        INTEGER(LPSTR) lpszAddress   ! Recipient address (optional)             
        INTEGER ulEIDSize            ! Count in INTEGER(1)s of size of pEntryID       
        INTEGER(LPVOID) lpEntryID    ! System-specific recipient reference      
    END TYPE T_MapiRecipDesc

    INTEGER, PARAMETER :: MAPI_ORIG  = 0           ! Recipient is message originator          
    INTEGER, PARAMETER :: MAPI_TO    = 1           ! Recipient is a primary recipient         
    INTEGER, PARAMETER :: MAPI_CC    = 2           ! Recipient is a copy recipient            
    INTEGER, PARAMETER :: MAPI_BCC   = 3           ! Recipient is blind copy recipient        

    TYPE T_MapiMessage
        INTEGER ulReserved                    ! Reserved for future USE (M.B. 0)       
        INTEGER(LPSTR) lpszSubject            ! Message Subject                        
        INTEGER(LPSTR) lpszNoteText           ! Message Text                           
        INTEGER(LPSTR) lpszMessagetype        ! Message Class                          
        INTEGER(LPSTR) lpszDateReceived       ! in YYYY/MM/DD HH:MM format             
        INTEGER(LPSTR) lpszConversationID     ! conversation thread ID                 
        INTEGER flFlags                       ! unread,return receipt                  
        INTEGER(LPVOID) lpOriginator          ! Originator descriptor                  
        INTEGER nRecipCount                   ! Number of recipients                   
        INTEGER(LPVOID) lpRecips              ! Recipient descriptors                  
        INTEGER nFileCount                    ! # of file attachments                  
        INTEGER(LPVOID) lpFiles               ! Attachment descriptors                 
    END TYPE T_MapiMessage

    INTEGER, PARAMETER :: MAPI_UNREAD             =#00000001
    INTEGER, PARAMETER :: MAPI_RECEIPT_REQUESTED  =#00000002
    INTEGER, PARAMETER :: MAPI_SENT               =#00000004

    !
    ! *  flFlags values for Simple MAPI entry points. All documented INTEGER are
    ! *  shown for each call. Duplicates are commented out but remain present
    ! *  for every call.
    ! 

    ! MAPILogon() INTEGER.       

    INTEGER, PARAMETER :: MAPI_LOGON_UI           =#00000001  ! Display logon UI             
    INTEGER, PARAMETER :: MAPI_PASSWORD_UI        =#00020000  ! prompt for password only     
    INTEGER, PARAMETER :: MAPI_NEW_SESSION        =#00000002  ! Don't USE shared session     
    INTEGER, PARAMETER :: MAPI_FORCE_DOWNLOAD     =#00001000  ! Get new mail before return   
    INTEGER, PARAMETER :: MAPI_EXTENDED           =#00000020  ! Extended MAPI Logon          

    ! MAPISendMail() INTEGER.    

    ! INTEGER, PARAMETER :: MAPI_LOGON_UI        #00000001     Display logon UI             
    ! INTEGER, PARAMETER :: MAPI_NEW_SESSION     #00000002     Don't USE shared session     

    !#ifndef MAPI_DIALOG             ! also defined in property.h 
    INTEGER, PARAMETER :: MAPI_DIALOG             =#00000008  ! Display a sEND note UI       
    !#endif
    !# define MAPI_USE_DEFAULT     #00000040     USE default profile in logon 

    ! MAPIFindNext() INTEGER.

    INTEGER, PARAMETER :: MAPI_UNREAD_ONLY        =#00000020  ! Only unread messages         
    INTEGER, PARAMETER :: MAPI_GUARANTEE_FIFO     =#00000100  ! USE date order               
    INTEGER, PARAMETER :: MAPI_LONG_MSGID         =#00004000  ! allow 512 char returned ID   

    ! MAPIReadMail() INTEGER.    

    INTEGER, PARAMETER :: MAPI_PEEK               =#00000080  ! Do not mark as read.         
    INTEGER, PARAMETER :: MAPI_SUPPRESS_ATTACH    =#00000800  ! header + body, no files      
    INTEGER, PARAMETER :: MAPI_ENVELOPE_ONLY      =#00000040  ! Only header information      
    INTEGER, PARAMETER :: MAPI_BODY_AS_FILE       =#00000200

    ! MAPISaveMail() INTEGER.    

    ! INTEGER, PARAMETER :: MAPI_LOGON_UI        #00000001     Display logon UI             
    ! INTEGER, PARAMETER :: MAPI_NEW_SESSION     #00000002     Don't USE shared session     
    ! INTEGER, PARAMETER :: MAPI_LONG_MSGID      #00004000  ! allow 512 char returned ID   

    ! MAPIAddress() INTEGER.     

    ! INTEGER, PARAMETER :: MAPI_LOGON_UI        #00000001     Display logon UI             
    ! INTEGER, PARAMETER :: MAPI_NEW_SESSION     #00000002     Don't USE shared session     

    ! MAPIDetails() INTEGER.     

    ! INTEGER, PARAMETER :: MAPI_LOGON_UI        #00000001     Display logon UI             
    ! INTEGER, PARAMETER :: MAPI_NEW_SESSION     #00000002     Don't USE shared session     
    INTEGER, PARAMETER :: MAPI_AB_NOMODIFY       = #00000400  ! Don't allow mods of AB entries 

    ! MAPIResolveName() INTEGER. 

    ! INTEGER, PARAMETER :: MAPI_LOGON_UI        #00000001     Display logon UI             
    ! INTEGER, PARAMETER :: MAPI_NEW_SESSION     #00000002     Don't USE shared session     
    ! INTEGER, PARAMETER :: MAPI_DIALOG          #00000008     Prompt for choices if ambiguous 
    ! INTEGER, PARAMETER :: MAPI_AB_NOMODIFY     #00000400     Don't allow mods of AB entries 

    INTEGER, PARAMETER :: MAPI_NO_COINIT         = #00000008 


END MODULE mapity

The send-mail functions of my MAPI module are (again) abstracted from a much larger program, wherein the email output can be sent to a set of email addresses read from a file.  You can ignore that context, as well as the fact that the email sending has been put into a separate thread (there's a lot going on in the parent program) and focus on the simple sending of text as an email.  The MAPI code as written loads elements of a UDT ("args") with buffers mailto (the destination address) and logbuf (the msg text).  The minimum activity would be to call start_mail_session() which returns a handle, and pass this to routine mailout() which is just a wrapper for the WinAPI function send_mail().  All the rest of the MAPI module is context and window-dressing.

0 Kudos
Highlighted
Black Belt Retired Employee
96 Views

jmloriot, I am guessing that you get an e-mail when someone responds to a post of yours here (as that's the default). Rather than starting a new thread with the unhelpful title of "e-mail", please follow the link in the email to your original forum thread and add a reply there. Users are not sending you e-mail directly (they can't), and the lack of context makes it hard to help you more.

0 Kudos
Highlighted
Beginner
96 Views

Well, the ability of user's to control which messages they receive emails for is extremely limited.  I receive emails for threads that I've never looked at and for all new topics regardless of interest (sometimes two).  When I try to change email preferences, it tells me that my email address (and country) are not registered, even though that's the email address receiving the forum emails.  Maybe I'm not finding the right screen (I would expected on my forum profile).  It doesn't seem to be the email preferences hidden at the bottom.

0 Kudos
Highlighted
Black Belt Retired Employee
96 Views

Look for a button that looks like this:

Screenshot_2.jpg

just above the list of forum threads on the main forum page. If yours says "Unsubscribe", then click that. This is what emails you every new post.

If you start a new thread, you're automatically subscribed to the thread and it doesn't seem possible to turn that off. Also, they've removed the ability to control automatic subscriptions. I don't even see the email preferences page you mention.

0 Kudos
Highlighted
Beginner
96 Views

Paul,

Starting from your MAPI program, I have been able to have my program send an Email.

A great thank you 

There are still some points I need to improve, but now I know where to look for.

0 Kudos