smtpable
1 Procedure Reference
make-mail
mail-from
mail-tos
mail-subject
mail-content
mail-attachment-files
mail-header
mail-header/  info
mail-header/  attachment
send-mail
2 Example
7.4

smtpable

 (require smtpable) package: smtpable

send emails with SMTP protocol. This is a library pkg splited from chive.

source code

    1 Procedure Reference

    2 Example

1 Procedure Reference

procedure

(make-mail recipients    
  subject    
  content    
  #:sender sender    
  #:attachments attachments)  mail?
  recipients : list?
  subject : string?
  content : string?
  sender : string?
  attachments : list?
make an email data with mail struct.

procedure

(mail-from email)  string?

  email : mail?
returns info about who the email was sent from.

procedure

(mail-tos email)  list?

  email : mail?
returns info about who this email was sent to.

procedure

(mail-subject email)  string?

  email : mail?
returns the email subject.

procedure

(mail-content email)  string?

  email : mail?
returns the email content.

procedure

(mail-attachment-files email)  list?

  email : mail?
returns a list of the email attachment file paths.

procedure

(mail-header email)  string?

  email : mail?
returns header string of the email.

procedure

(mail-header/info email)  string?

  email : mail?
returns sender, recipients, subject infos of an email’s header.

procedure

(mail-header/attachment email)  string?

  email : mail?
returns sender, recipients, subject infos of an email’s header.

procedure

(send-mail email    
  #:host host    
  [#:port port    
  #:user username]    
  #:password password)  void?
  email : mail?
  host : string?
  port : integer? = 25
  username : string? = (mail-from mail)
  password : string?
commit the email sending action.

2 Example

 
(define email (make-mail '("user1@qq.com", "user2@qq.com") ; recipients
                           "email subject"
                           "email content"
                           #:attachments '("file-path1" "file-path2") ; optinal argument
                           ))
 
(mail-header/info email)
(mail-header/attachment email)
 
(send-mail email
           #:host "smtp.qq.com"
           #:username "me@qq.com"
           #:password "the-password")