:doc:`WorkMail <../../workmail>` / Client / list_mail_domains

*****************
list_mail_domains
*****************



.. py:method:: WorkMail.Client.list_mail_domains(**kwargs)

  

  Lists the mail domains in a given WorkMail organization.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListMailDomains>`_  


  **Request Syntax**
  ::

    response = client.list_mail_domains(
        OrganizationId='string',
        MaxResults=123,
        NextToken='string'
    )
    
  :type OrganizationId: string
  :param OrganizationId: **[REQUIRED]** 

    The WorkMail organization for which to list domains.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return in a single call.

    

  
  :type NextToken: string
  :param NextToken: 

    The token to use to retrieve the next page of results. The first call does not require a token.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'MailDomains': [
              {
                  'DomainName': 'string',
                  'DefaultDomain': True|False
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **MailDomains** *(list) --* 

        The list of mail domain summaries, specifying domains that exist in the specified WorkMail organization, along with the information about whether the domain is or isn't the default.

        
        

        - *(dict) --* 

          The data for a given domain.

          
          

          - **DomainName** *(string) --* 

            The domain name.

            
          

          - **DefaultDomain** *(boolean) --* 

            Whether the domain is default or not.

            
      
    
      

      - **NextToken** *(string) --* 

        The token to use to retrieve the next page of results. The value becomes ``null`` when there are no more results to return.

        
  
  **Exceptions**
  
  *   :py:class:`WorkMail.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationNotFoundException`

  
  *   :py:class:`WorkMail.Client.exceptions.OrganizationStateException`

  