Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/net/MailTo#constants) \| [Methods](https://developer.android.com/reference/android/net/MailTo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/net/MailTo#inhmethods)

# MailTo

*** ** * ** ***


`
public


class
MailTo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.MailTo |

<br />

*** ** * ** ***

MailTo URL parser

This class parses a mailto scheme URL and then can be queried for
the parsed parameters. This implements RFC 2368.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/net/MailTo#MAILTO_SCHEME` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/MailTo#getBody()() ` Retrieve the body line from the parsed mailto URL. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/MailTo#getCc()() ` Retrieve the CC address line from the parsed mailto URL. |
| ` https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/net/MailTo#getHeaders()() ` Retrieve all the parsed email headers from the mailto URL |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/MailTo#getSubject()() ` Retrieve the subject line from the parsed mailto URL. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/MailTo#getTo()() ` Retrieve the To address line from the parsed mailto URL. |
| ` static boolean` | ` https://developer.android.com/reference/android/net/MailTo#isMailTo(java.lang.String)(https://developer.android.com/reference/java/lang/String url) ` Test to see if the given string is a mailto URL |
| ` static https://developer.android.com/reference/android/net/MailTo` | ` https://developer.android.com/reference/android/net/MailTo#parse(java.lang.String)(https://developer.android.com/reference/java/lang/String url) ` Parse and decode a mailto scheme string. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/net/MailTo#toString()() ` Returns a string representation of the object. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### MAILTO_SCHEME

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String MAILTO_SCHEME
```

<br />

<br />

Constant Value:

"mailto:"


## Public methods

### getBody

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getBody ()
```

Retrieve the body line from the parsed mailto URL.
If no body line was specified, then null is return

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | body or null <br /> |

### getCc

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getCc ()
```

Retrieve the CC address line from the parsed mailto URL. This could be
several email address that are comma-space delimited.
If no CC line was specified, then null is return

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | comma delimited email addresses or null <br /> |

### getHeaders

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Map<String, String> getHeaders ()
```

Retrieve all the parsed email headers from the mailto URL

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Map<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/java/lang/String>` | map containing all parsed values <br /> |

### getSubject

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getSubject ()
```

Retrieve the subject line from the parsed mailto URL.
If no subject line was specified, then null is return

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | subject or null <br /> |

### getTo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getTo ()
```

Retrieve the To address line from the parsed mailto URL. This could be
several email address that are comma-space delimited.
If no To line was specified, then null is return

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | comma delimited email addresses or null <br /> |

### isMailTo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static boolean isMailTo (String url)
```

Test to see if the given string is a mailto URL

<br />

| Parameters ||
|---|---|
| `url` | `String`: string to be tested <br /> |

| Returns ||
|---|---|
| `boolean` | true if the string is a mailto URL <br /> |

### parse

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static MailTo parse (String url)
```

Parse and decode a mailto scheme string. This parser implements
RFC 2368. The returned object can be queried for the parsed parameters.

<br />

| Parameters ||
|---|---|
| `url` | `String`: String containing a mailto URL <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/MailTo` | MailTo object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/net/ParseException` | if the scheme is not a mailto URL |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |