smtp-lib
1 Procedure Reference
mail-from
mail-tos
mail-subject
mail-content
mail-attachment-files
mail-header
mail-header/  info
mail-header/  attachment
send-smtp-mail
2 Example
7.6

smtp-lib

 (require smtp-lib) package: smtp-lib

send emails with SMTP protocol.

source code

    1 Procedure Reference

    2 Example

1 Procedure Reference

mail struct needs specified here.

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-smtp-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 (mail "my-email-name@qq.com" ; sender's email
                    '("user1@qq.com", "user2@qq.com") ; recipient's emails
                    "email subject"
                    "email content"
                    '("file-path1" "file-path2") ; attachment files
                ))
 
(send-smtp-mail email
                #:host "smtp.qq.com"
                #:auth-user "my-email-name"
                #:auth-password "the-password")