Rendering Email Messages

Note
Note:  The features listed in this page are supported only in GroupDocs.Viewer Cloud V1

When rendering email messages by GroupDocs.Viewer uses English language to render field labels such as (From, To, Subject etc.). To change field labels you can set FieldLabels on EmailOptions class.

Viewer supports following field labels:

FieldLabel
AnniversaryAnniversary
BccBcc
BirthdayBirthday
BusinessBusiness
Business AddressBusiness Address
Business FaxBusiness Fax
BusinessHomepageBusinessHomepage
CompanyCompany
DepartmentDepartment
EmailEmail
Email Display AsEmail Display As
Email2Email2
Email2 Display AsEmail2 Display As
Email3Email3
Email3 Display AsEmail3 Display As
EndEnd
First NameFirst Name
FromFrom
Full NameFull Name
GenderGender
HobbiesHobbies
Home AddressHome Address
ImportanceImportance
Job TitleJob Title
Last NameLast Name
LocationLocation
Middle NameMiddle Name
MobileMobile
OrganizerOrganizer
Other AddressOther Address
PersonalHomepagePersonalHomepage
ProfessionProfession
RecurrenceRecurrence
Recurrence PatternRecurrence Pattern
Required AttendeesRequired Attendees
SentSent
Show Time AsShow Time As
Spouse/PartnerSpouse/Partner
StartStart
SubjectSubject
ToTo
User Field 1User Field 1
User Field 2User Field 2
User Field 3User Field 3
User Field 4User Field 4

The following GroupDocs.Viewer Cloud REST API resource has been used to Render Email as HTML.

cURL example

# Set field labels when rendering pages
curl --request POST \
url https://api.groupdocs.cloud/v1/viewer/sample.msg/html/pages \
header 'authorization: [Access Token]' \
header 'content-type: application/json' \
data '{"emailOptions": {"fieldLabels": [{"Field":"From", "Label":"Sender"}, {"Field":"To", "Label":"Receiver"}]}}'

# Retrieve created page
curl request GET \
url https://api.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1 \
header 'authorization: [Access Token]'
{
  "fileName": "sample.msg",
  "pages": [
    {
      "number": 1,
      "resources": [
        {
          "name": "font.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font.ttf"
        },
        {
          "name": "font1.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font1.ttf"
        },
        {
          "name": "font2.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font2.ttf"
        },
        {
          "name": "styles.css",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/styles.css"
        }
      ],
      "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1"
    }
  ]
}

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Render Email documents as Image with Setting to set  Page Size

It is possible to set output page size for rendering Email documents into PDF.

The following GroupDocs.Viewer Cloud REST API resource has been used to Render Email as HTML.

cURL example

# Set page size when rendering pages  curl request POST \ 
url http://api.groupdocs.cloud/v1/viewer/message.msg/image/pages 
header 'authorization: [Access Token]'  header 'content-type: application/json' \
data '{"emailOptions": {"pageSize": "A0"}}' 

# Retrieve created page  curl request GET \ 
url http://api.groupdocs.cloud/v1/viewer/message.msg/image/pages/1 
header 'authorization: [Access Token]'
{
  "fileName": "sample.msg",
  "pages": [
    {
      "number": 1,
      "resources": [
        {
          "name": "font.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font.ttf"
        },
        {
          "name": "font1.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font1.ttf"
        },
        {
          "name": "font2.ttf",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/font2.ttf"
        },
        {
          "name": "styles.css",
          "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1/resources/styles.css"
        }
      ],
      "url": "https://api-dev.groupdocs.cloud/v1/viewer/sample.msg/html/pages/1"
    }
  ]
}

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.