Dagger
Search

email-smtp

This module send a email using a SMTP server

Installation

dagger install github.com/ernesto27/daggerverse/email-smtp@v0.1.1

Entrypoint

Return Type
EmailSmtp
Example
dagger -m github.com/ernesto27/daggerverse/email-smtp@7dc6ec6cb5bf7f48a7e5c0578779388dba975380 call \
func (m *myModule) example() *EmailSmtp  {
	return dag.
			EmailSmtp()
}
@function
def example() -> dag.EmailSmtp:
	return (
		dag.email_smtp()
	)
@func()
example(): EmailSmtp {
	return dag
		.emailSmtp()
}

Types

EmailSmtp 🔗

send() 🔗

Example usage:

dagger -m github.com/ernesto27/daggerverse/email-smtp call send  \
	--from="from@gmail.com" \
	--to="someemail@gmail.com" \
	--subject="Hello" \
	--body="Hello, World!" \
	--host="smtp.mailtrap.io" \
	--port=587  \
	--username env:SMTP_USERNAME \
	--password env:SMPT_PASSWORD
Return Type
String !
Arguments
NameTypeDefault ValueDescription
fromString !-From email address
toString !-To email address
subjectString !-Email subject
bodyString !-Email body
hostString !-SMTP server host
portInteger 587SMTP server port
usernameSecret !-SMTP username
passwordSecret !-SMTP password
Example
dagger -m github.com/ernesto27/daggerverse/email-smtp@7dc6ec6cb5bf7f48a7e5c0578779388dba975380 call \
 send --from string --to string --subject string --body string --host string --username env:MYSECRET --password env:MYSECRET
func (m *myModule) example(ctx context.Context, from string, to string, subject string, body string, host string, username *Secret, password *Secret) string  {
	return dag.
			EmailSmtp().
			Send(ctx, from, to, subject, body, host, username, password)
}
@function
async def example(from_: str, to: str, subject: str, body: str, host: str, username: dagger.Secret, password: dagger.Secret) -> str:
	return await (
		dag.email_smtp()
		.send(from_, to, subject, body, host, username, password)
	)
@func()
async example(from: string, to: string, subject: string, body: string, host: string, username: Secret, password: Secret): Promise<string> {
	return dag
		.emailSmtp()
		.send(from, to, subject, body, host, username, password)
}