GetMailAttribute()

Syntax

Result$ = GetMailAttribute(#Mail, Attribute)
Description
Return the specified mail attribute.

Parameters

#Mail The mail to use.
Attribute The attribute to get. It may be one of the following values:
  #PB_Mail_From   : Get the 'From' attribute, set with CreateMail().
  #PB_Mail_Subject: Get the 'Subject' attribute, set with CreateMail().
  #PB_Mail_XMailer: Get the 'X-Mailer' attribute (if any)
  #PB_Mail_Date   : Get the 'Date' attribute (if any)
  #PB_Mail_Custom : Get customs fields (if any)

Return value

Returns the attribute as a string. An empty string is returned if the attribute does not exist.

Remarks

SetMailAttribute() may be used to change the #Mail attributes.

Example

  InitNetwork()

  If CreateMail(0, "test@purebasic.com", "Hello")
    Debug GetMailAttribute(0, #PB_Mail_From)    ; Will print "test@purebasic.com"
    Debug GetMailAttribute(0, #PB_Mail_Subject) ; Will print "Hello"
  EndIf

See Also

SetMailAttribute(), CreateMail()

Supported OS

All

<- FreeMail() - Mail Index - GetMailBody() ->