-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
53 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <urweb.h> | ||
|
||
typedef struct headers *uw_Email_headers; | ||
|
||
extern uw_Email_headers uw_Email_empty; | ||
|
||
uw_Email_headers uw_Email_from(uw_context, uw_Basis_string, uw_Email_headers); | ||
uw_Email_headers uw_Email_to(uw_context, uw_Basis_string, uw_Email_headers); | ||
uw_Email_headers uw_Email_cc(uw_context, uw_Basis_string, uw_Email_headers); | ||
uw_Email_headers uw_Email_bcc(uw_context, uw_Basis_string, uw_Email_headers); | ||
uw_Email_headers uw_Email_subject(uw_context, uw_Basis_string, uw_Email_headers); | ||
|
||
uw_unit uw_Email_send(uw_context, uw_Basis_string server, | ||
uw_Basis_bool ssl, uw_Basis_string ca, | ||
uw_Basis_string user, uw_Basis_string password, | ||
uw_Email_headers, uw_Basis_string body, uw_Basis_string xbody); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
val server = "smtp://you.com:465" | ||
val user = "you" | ||
val password = "pass" | ||
val send = Mail.send server True None user password | ||
val send = Email.send server True None user password | ||
|
||
fun solicitText (user : string) : transaction string | ||
= key <- rand; | ||
|
@@ -31,18 +31,18 @@ fun solicitText (user : string) : transaction string | |
"Your System.\n" | ||
) | ||
|
||
val sendOneMail (from : string) (to : string) (subject : string) (text : string) : transaction unit | ||
= send (Mail.subject subject (Mail.to to (Mail.from from Mail.empty))) text None | ||
val sendOneEmail (from : string) (to : string) (subject : string) (text : string) : transaction unit | ||
= send (Email.subject subject (Email.to to (Email.from from Email.empty))) text None | ||
|
||
val sendMails : transaction unit | ||
val sendEmails : transaction unit | ||
= users <- return ("[email protected]" :: "[email protected]" :: "[email protected]" :: []); | ||
List.app | ||
(fn user => | ||
text <- solicitText user; | ||
sendOneMail "[email protected]" user "soliciting your data" text | ||
sendOneEmail "[email protected]" user "soliciting your data" text | ||
) | ||
users | ||
|
||
fun main () : transaction page | ||
= sendMails; | ||
= sendEmails; | ||
return <xml>Sent</xml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
val sendMails : transaction unit | ||
val sendEmails : transaction unit | ||
val main : unit -> transaction page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ffi mail | ||
include mail.h | ||
link -lurweb_mail -lcurl | ||
effectful Mail.send | ||
ffi email | ||
include email.h | ||
link -lurweb_email -lcurl | ||
effectful Email.send |