YOUSEFUL / FILEMAKER
Youseful Mail: FAQ, examples and tutorial
Learning center · Function reference
Use YsflMail.fmx64 to send SMTP messages, retrieve POP3/IMAP messages and parse
MIME content. This first tutorial parses a local fixture: it needs no account
and sends no mail.
FAQ
Does Send returning 0 prove delivery to the inbox? It means the SMTP transaction completed successfully. Later delivery, filtering and bounces are handled by the mail system.
Will it work with an OAuth-only mailbox? The current Mail API exposes user/password authentication and SMTP PLAIN/LOGIN, not an OAuth2 token flow. Use an authentication method your test provider actually permits.
Does retrieving an IMAP message mark it as read? ImapGet is implemented to fetch the message without marking it read. Flags and deletion are separate calls.
Can I parse an existing .eml message without connecting? Yes. Supply its raw message text to Header, Body and Attachments. MIME messages use headers followed by a blank line and the body.
Examples
Read a subject:
YsflMl_Header (
"Subject: Hello Youseful" & Char ( 13 ) & Char ( 10 ) & Char ( 13 ) & Char ( 10 ) & "Body" ;
"Subject"
)Result: Hello Youseful.
Read a plain-text body:
YsflMl_Body (
"Content-Type: text/plain; charset=UTF-8" &
Char ( 13 ) & Char ( 10 ) & Char ( 13 ) & Char ( 10 ) &
"Your order is ready."
)Result: Your order is ready.
Tutorial
Standalone sample scripts: Parse a message.
Goal: decode an encoded subject and extract a message body.
- Create a script named
Youseful - Parse a message. - Add these steps.
$crlfcreates the line ending expected in raw email.
Set Variable [ $crlf ; Value: Char ( 13 ) & Char ( 10 ) ]
Set Variable [ $raw ; Value:
"From: sender@example.com" & $crlf &
"To: reader@example.com" & $crlf &
"Subject: =?UTF-8?Q?Hello_Youseful?=" & $crlf &
"MIME-Version: 1.0" & $crlf &
"Content-Type: text/plain; charset=UTF-8" & $crlf & $crlf &
"Your order is ready."
]
Set Variable [ $subject ; Value: YsflMl_Header ( $raw ; "Subject" ) ]
Set Variable [ $error ; Value: YsflMl_LastError ]
If [ $error <> 0 ]
Exit Script [ Text Result: $subject ]
End If
Set Variable [ $body ; Value: YsflMl_Body ( $raw ; "text" ) ]
Set Variable [ $error ; Value: YsflMl_LastError ]
If [ $error <> 0 ]
Exit Script [ Text Result: $body ]
End If
Show Custom Dialog [ $subject ; $body ]- Run it. Expected title:
Hello Youseful. Expected body:Your order is ready. - In a later integration, replace
$rawwith the result of a successful Pop3Get or ImapGet call. Capture that retrieval error before starting parsing.
Troubleshooting
Keep the blank line between headers and body. Ask Body for html only when you
want the HTML part. For a real connection, use your provider's exact hostname,
port and TLS mode; for example, an IMAPS endpoint normally specifies port 993.
Mailbox UIDs, message indexes and attachment indexes are different identifiers.