[Last Call] Learn how to a build a cloud-first strategyRegister Now


VB6 Read Email Headers

Posted on 2007-10-11
Medium Priority
Last Modified: 2013-12-26
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 ??
Question by:itimes
  • 4
  • 3
LVL 59

Expert Comment

by:Chris Bottomley
ID: 20055762
I presume you need the senderemailaddress property?


Author Comment

ID: 20056005

Some Emails are being recived where the "Friom" address differs from the reply-to address.
LVL 59

Expert Comment

by:Chris Bottomley
ID: 20056141
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.

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 20056347
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 !
LVL 59

Expert Comment

by:Chris Bottomley
ID: 20058362
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
    End With
End Sub

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

LVL 59

Accepted Solution

Chris Bottomley earned 740 total points
ID: 20058393
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


Author Comment

ID: 20064120
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 !

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question