Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
32
Task/Send-email/Fantom/send-email.fantom
Normal file
32
Task/Send-email/Fantom/send-email.fantom
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using email
|
||||
|
||||
class Mail
|
||||
{
|
||||
// create a client for sending email - add your own host/username/password
|
||||
static SmtpClient makeClient ()
|
||||
{
|
||||
client := SmtpClient
|
||||
{
|
||||
host = "yourhost"
|
||||
username = "yourusername"
|
||||
password = "yourpassword"
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
public static Void main()
|
||||
{
|
||||
// create email
|
||||
email := Email
|
||||
{
|
||||
to = ["to@addr"]
|
||||
from = "from@addr"
|
||||
cc = ["cc@addr"]
|
||||
subject = test"
|
||||
body = TextPart { text = "test email" }
|
||||
}
|
||||
|
||||
// create client and send email
|
||||
makeClient.send (email)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue