gdDocumentation0.8.0

API reference

GDSMTPClient

Reuse one SMTP session for greeting, authentication, recipients, DATA transfer, and shutdown.

Methods

hello

hello(name: String = "localhost") -> Dictionary, Err

Introduce the session with EHLO or HELO.

Parameters

NameTypeDefaultDescription
nameString"localhost"Name used to register or look up the corresponding entry.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

hello_async

hello_async(name: String = "localhost") -> await Dictionary, Err

Introduce the session with EHLO or HELO.

Parameters

NameTypeDefaultDescription
nameString"localhost"Name used to register or look up the corresponding entry.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

start_tls

start_tls(opts: Dictionary = {  }) -> Dictionary, Err

Upgrade the existing SMTP connection to verified TLS.

Parameters

NameTypeDefaultDescription
optsDictionary{ }Named options for this operation. Omitted entries use their documented defaults.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

start_tls_async

start_tls_async(opts: Dictionary = {  }) -> await Dictionary, Err

Upgrade the existing SMTP connection to verified TLS.

Parameters

NameTypeDefaultDescription
optsDictionary{ }Named options for this operation. Omitted entries use their documented defaults.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

auth

auth(config: Dictionary) -> Dictionary, Err

Authenticate after transport policy is checked.

Parameters

NameTypeDefaultDescription
configDictionaryRequiredAuthentication settings including kind, user, secret and optional identity.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

auth_async

auth_async(config: Dictionary) -> await Dictionary, Err

Authenticate after transport policy is checked.

Parameters

NameTypeDefaultDescription
configDictionaryRequiredAuthentication settings including kind, user, secret and optional identity.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

mail

mail(from: String) -> Dictionary, Err

Start one SMTP envelope.

Parameters

NameTypeDefaultDescription
fromStringRequiredStarting point used by the operation.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

mail_async

mail_async(from: String) -> await Dictionary, Err

Start one SMTP envelope.

Parameters

NameTypeDefaultDescription
fromStringRequiredStarting point used by the operation.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

rcpt

rcpt(to: String) -> Dictionary, Err

Add one recipient to the envelope.

Parameters

NameTypeDefaultDescription
toStringRequiredDestination selected by the operation.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

rcpt_async

rcpt_async(to: String) -> await Dictionary, Err

Add one recipient to the envelope.

Parameters

NameTypeDefaultDescription
toStringRequiredDestination selected by the operation.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

data

data() -> GDSMTPDataWriter, Err

Enter DATA mode and return a typed writer.

Parameters

No parameters.

Return value

GDSMTPDataWriter, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

data_async

data_async() -> await GDSMTPDataWriter, Err

Enter DATA mode and return a typed writer.

Parameters

No parameters.

Return value

await GDSMTPDataWriter, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

reset

reset() -> Dictionary, Err

Reset the active envelope.

Parameters

No parameters.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

reset_async

reset_async() -> await Dictionary, Err

Reset the active envelope.

Parameters

No parameters.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

noop

noop() -> Dictionary, Err

Check whether the SMTP peer responds.

Parameters

No parameters.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

noop_async

noop_async() -> await Dictionary, Err

Check whether the SMTP peer responds.

Parameters

No parameters.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

verify

verify(address: String) -> Dictionary, Err

Ask the peer about one address.

Parameters

NameTypeDefaultDescription
addressStringRequiredMailbox address submitted to the SMTP VRFY command.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

verify_async

verify_async(address: String) -> await Dictionary, Err

Ask the peer about one address.

Parameters

NameTypeDefaultDescription
addressStringRequiredMailbox address submitted to the SMTP VRFY command.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

quit

quit() -> Dictionary, Err

End the SMTP session and close its transport.

Parameters

No parameters.

Return value

Dictionary, Err

Suspends only the calling routine until the operation completes. No explicit await is needed.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

quit_async

quit_async() -> await Dictionary, Err

End the SMTP session and close its transport.

Parameters

No parameters.

Return value

await Dictionary, Err

Returns a Signal. Use await to receive the completion value shown in the signature.

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.

close

close() -> void

Release the SMTP transport immediately.

Parameters

No parameters.

Return value

void

No value is returned.

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

extension

extension(name: String) -> Dictionary

Read one advertised SMTP extension.

Parameters

NameTypeDefaultDescription
nameStringRequiredName used to register or look up the corresponding entry.

Return value

Dictionary

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

tls_state

tls_state() -> Dictionary

Read the connection's TLS negotiation state.

Parameters

No parameters.

Return value

Dictionary

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.