Class MailAddress() Professional

Class function of the MailAddress class.

Description

Instances of the MailAddress class take care of the various formatting rules for e-mail addresses. For example, all following addresses are valid e-mail addresses of the same person:

John Doe <jd@mail.com> 
"John Doe" <jd@mail.com> 
jd@mail.com (The good guy) 
JD@mail.com 

Therefore, the definition of sender and recipient addresses of an e-mail is done using MailAddress objects.

Class methods
:new()
Creates an instance of the MailAddress class.
Instance methods
:getString()
Retrieves the e-mail address as character string.
Examples
Defining sender and recipient of an e-mail
// The example is a code snippet that demonstrates the 
// context where MailAddress objects are used. See the 
// MIMEMessage() class for a comprehensive example. 

oMail      := MIMEMessage():new() 
oSender    := MailAddress():new( "John <jd@mail.com>", .T. ) 
oRecipient := MailAddress():new( "JaneDoe@shop.com ( lovely wive )" ) 

oMail:setFrom( oSender ) 
oMail:addRecipient( oRecipient ) 

? oSender:getString()       ->     "jd@mail.com" 
? oRecipient:getString()    ->     "JaneDoe@shop.com ( lovely wive )" 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.