Add an extra header item to current email.
[Syntax] C++: HRESULT AddHeader( BSTR bstrKey, BSTR bstrValue ) Visual basic: AddHeader( bstrKey As String, bstrValue As String ) C#: void AddHeader( string bstrKey, string bstrValue )
Parameters
bstrKey
Header name.
bstrValue
Header value.
Remarks
This method can add customized header to current email. For example, you can add a header to flag current email is new or old
Usage Example
[VBScript]
Dim oMsg
Set oMsg = CreateObject("ANPOP.POPMSG")
If oMsg.ImportFile("c:\test.eml") = 0 Then
If oMsg.GetHeaderItem("X-Email-Status") <> "" Then
WScript.Echo "old email"
Else
oMsg.AddHeader "X-Email-Status", "old"
oMsg.ExportFile "c:\test.eml" 'save this email to take effect
End If
Else
WScript.Echo "error with ImportFile"
End If
See Also
GetHeaderItem Method
RemoveHeader Method
2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.