Visual FoxPro
Visual FoxPro
Set the Email From Header
See more Email Object Examples
Demonstrates the Chilkat Email.From property, which contains the sender name and email address as they appear in the MIME From header, such as John Smith <john.smith@example.com>. The From, FromName, and FromAddress properties are different views of the same MIME From header. This example sets From and reads back all three views.
Background: The internet message standard (RFC 5322) formats a sender as an optional display name followed by the address in angle brackets:
Display Name <user@domain>. The display name is what a mail client typically shows in the inbox, while the bracketed address is the actual routing destination. Note that this visible From header is separate from the SMTP envelope sender used during delivery, which is why spoofing a From is possible — and why standards like SPF, DKIM, and DMARC exist to verify it.Chilkat Visual FoxPro Downloads
LOCAL loEmail
* Demonstrates the Email.From property, which contains the sender name and
* email address as they appear in the From header, such as
* "John Smith <john.smith@example.com>".
* From, FromName, and FromAddress are different views of the same From header.
loEmail = CreateObject('Chilkat.Email')
loEmail.From = "John Smith <john.smith@example.com>"
? "From = " + loEmail.From
? "FromName = " + loEmail.FromName
? "FromAddress = " + loEmail.FromAddress
RELEASE loEmail