VB6 Read Email Headers

Is it possible using VB 6 to read a Email Header ??

I'm using Mapi to read through E-mails but I need to read in the Reply To address but  I can't find this property within Mapi so I was wondering if I can read in the Email headers then extract the reply-to section ??
itimesAsked:
Who is Participating?
 
Chris BottomleyConnect With a Mentor Software Quality Lead EngineerCommented:
The CDO is a send reference of course but easy to put my hands on!

the references for both redemption and CDO are therein, if you think about your preference, (redemption has a cost for commercial use but integrates with outlook whereas CDO is free but does not integrate very well) then I, (or anyone else) will try to help with specifics

Chris
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
I presume you need the senderemailaddress property?

Chris
0
 
itimesAuthor Commented:
Chris,

Some Emails are being recived where the "Friom" address differs from the reply-to address.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Chris BottomleySoftware Quality Lead EngineerCommented:
If it is the replyto in this context then I don't think MAPI has this property.  I think you can use CDO or redemption to access the replyto address though I haven't used either from VB6.

Chris
0
 
itimesAuthor Commented:
Chris if you can provide me with an example of either CDO or redemption  on VB 6 the poinst are yours .... will google myslef ofcorse too !
0
 
Chris BottomleySoftware Quality Lead EngineerCommented:
CDO, (see http://www.rondebruin.nl/cdo.htm):

    NewCDOMessage "Personal Data - Manual Config - Attempt " & i & ".", strHeader & strbody & strFooter, Cells(i, 1).Value, "", "", False

Public Sub NewCDOMessage(strSubject As String, strbody As String, Optional strTo As String, _
                            Optional strCC As String, Optional strBCC As String, Optional SendYN As Boolean, _
                            Optional AttachYN As Boolean = False, Optional Attach1 As String)

    Dim iMsg As Object
    Dim iConf As Object
    Dim str_body As String
'    Dim Flds As Variant

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")

    iConf.Load -1    ' CDO Source Defaults
'    Set Flds = iConf.Fields
'    With Flds
'        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
'                       = "YOUR SMTP"
'        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 7461        ' 25
'        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "YOUR ACCT"
'        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "YOURACCTPASS"
'
'        .Update
'    End With

    With iMsg
        Set .Configuration = iConf

        .To = strTo
        If strCC <> "" Then .CC = strCC
        If strBCC <> "" Then .BCC = strBCC
        .From = "fred@fred1.com"
        .Subject = strSubject
        .TextBody = strbody
        If AttachYN And Attach1 <> "" Then .AddAttachment Attach1
        .Send
    End With
End Sub

Redemption see http://www.dimastr.com/redemption/

Chris
0
 
itimesAuthor Commented:
Thanks for all your help, I hav now managed to Contact the source of the problem E-mails and change it their end.

Thanks for your time .... the points are yours !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.