Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
EmailParser.Header
Queries a header entry.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| EmailParser | 5.3 | Yes | Yes | Yes | Yes | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| EmailID | The ID fo the email parser. | |
| Index | The index from 0 to EmailParser.HeaderCount-1. | 0 |
| Selector | Which value to return. Can be "name" or "value". | "name" |
Result
Returns text or error.
Description
Queries a header entry.Common header values include Date, Subject, From and X-Mailer.
Examples
Query first header entry:
$name = MBS( "EmailParser.Header"; $EmailID; 0; "name" )
$value = MBS( "EmailParser.Header"; $EmailID; 0; "value" )
Find a header value by name:
Set Variable [$i; Value:0]
Set Variable [$c; Value:MBS("EmailParser.HeaderCount"; $email)]
If [$c > 0]
Loop
Set Variable [$HeaderName; Value:MBS("EmailParser.Header"; $email; $i; "name")]
If [$HeaderName = "X-Mailer"]
Set Variable [$HeaderValue; Value:MBS("EmailParser.Header"; $email; $i; "value")]
Set Field [Email Parser::Mailer; $HeaderValue]
End If
#next
Set Variable [$i; Value:$i + 1]
Exit Loop If [$i = $c]
End Loop
End If
Copy all headers into records:
Set Variable [ $i ; Value: 0 ]
Set Variable [ $c ; Value: MBS("EmailParser.HeaderCount"; $email) ]
If [ $c > 0 ]
Loop
Set Variable [ $HeaderName ; Value: MBS("EmailParser.Header"; $email; $i; "name") ]
Set Variable [ $HeaderValue ; Value: MBS("EmailParser.Header"; $email; $i; "value") ]
New Record/Request
Set Field [ EmailHeaders::EmailID ; $EmailRecordID ]
Set Field [ EmailHeaders::HeaderName ; $HeaderName ]
Set Field [ EmailHeaders::HeaderValue ; $HeaderValue ]
Commit Records/Requests [ With dialog: Off ]
# next
Set Variable [ $i ; Value: $i + 1 ]
Exit Loop If [ $i = $c ]
End Loop
End If
See also
- EmailParser.Hash
- EmailParser.HasHeader
- EmailParser.HeaderCount
- EmailParser.HeaderValue
- EmailParser.Parse
Example Databases
- CURL/Email/Email Client
- CURL/Email/Email Parser and Preview
- CURL/Email/Email Parser
- CURL/Email/IMAP Email
Release notes
- Version 7.4
- Added EmailParser.HasHeader and EmailParser.HeaderValue functions to make header queries easier.
Created 24th September 2015, last changed 9th June 2017
EmailParser.Hash - EmailParser.HeaderCount
Feedback: Report problem or ask question.
Links
MBS FileMaker blog