We help IT Professionals succeed at work.

New podcast episode! Our very own Community Manager, Rob Jurd, gives his insight on the value of an online community. Listen Now!

x

VB6 Read Email Headers

itimes
itimes asked
on
1,302 Views
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 ??
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2011

Commented:
I presume you need the senderemailaddress property?

Chris

Author

Commented:
Chris,

Some Emails are being recived where the "Friom" address differs from the reply-to address.
CERTIFIED EXPERT
Top Expert 2011

Commented:
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

Author

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 !
CERTIFIED EXPERT
Top Expert 2011

Commented:
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
CERTIFIED EXPERT
Top Expert 2011
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

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 !
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.