email-smtp
This module send a email using a SMTP server
Installation
dagger install github.com/ernesto27/daggerverse/email-smtp@v0.2.0
Entrypoint
Return Type
EmailSmtp
Example
dagger -m github.com/ernesto27/daggerverse/email-smtp@fe8701e19f4e360ee6b57f99a6dd3740d71f1888 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
--attachment="path/to/attachment" \
--embed="path/to/embed"
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
from | String ! | - | From email address |
to | String ! | - | To email address |
subject | String ! | - | Email subject |
body | String ! | - | Email body |
host | String ! | - | SMTP server host |
port | Integer | 587 | SMTP server port |
username | Secret ! | - | SMTP username |
password | Secret ! | - | SMTP password |
attachment | File | - | No description provided |
embed | File | - | No description provided |
Example
dagger -m github.com/ernesto27/daggerverse/email-smtp@fe8701e19f4e360ee6b57f99a6dd3740d71f1888 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)
}