PageRenderTime 31ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/ocamlnet-3.5.1/src/smtp/netsmtp.mli

#
OCaml | 85 lines | 18 code | 17 blank | 50 comment | 0 complexity | 2baacb54fe07de85c59fa5f423e991ff MD5 | raw file
Possible License(s): GPL-2.0
  1. (* $Id: netsmtp.mli 847 2005-05-23 10:49:08Z mad_coder $
  2. * ----------------------------------------------------------------------
  3. *)
  4. (**
  5. * This is an interface for the Simple Mail Tranfer Protocol (SMTP)
  6. * as specified by RFC 2821.
  7. *)
  8. open Netchannels
  9. exception Protocol_error
  10. exception Transient_error of int * string
  11. exception Permanent_error of int * string
  12. val tcp_port : int
  13. (** default TCP port for SMTP *)
  14. (** The class [client] implements the SMTP protocol. Client objects are created
  15. * by
  16. * {[ new client in_ch out_ch]}
  17. * where [in_ch] is an input channel representing the input direction of the
  18. * TCP stream, and where [out_ch] is an output channel representing the output
  19. * direction of the TCP stream.
  20. *)
  21. class client :
  22. in_obj_channel -> out_obj_channel ->
  23. object
  24. method helo : ?host:string -> unit -> string list
  25. (** Sends an HELLO command to the server. the optionnal argument [?host]
  26. * defaults to the default hostname of the machine. This function returns
  27. * the ESMTP lines returned by the server.
  28. *)
  29. method mail : string -> unit
  30. (** Performs a MAIL FROM command. the [string] argument is the mail address
  31. * (without < >) that sends the mail.
  32. *)
  33. method rcpt : string -> unit
  34. (** Performs a RCPT TO command. the [string] argument is one of the mail
  35. * address the mail has to be sent to. You have to use that function for
  36. * each recipient of the mail.
  37. *
  38. * If the server returns a 551 error (user relocated, see RFC 2821, section
  39. * 3.4), the relocated adress is silently used, and the error is not raised
  40. *)
  41. method data : in_obj_channel -> unit
  42. (** This method really send the mail.
  43. * Do not issue that command without having used [mail] once, and at least
  44. * [rcpt] once too
  45. *)
  46. method rset : unit -> unit
  47. (** Reset the current transaction *)
  48. method expn : string -> string list option
  49. (** Expand command : [expn list] will try to expand the Mailing list
  50. * [list]. If the list cannot be Expanded (reply 252) then [None] is
  51. * returned.
  52. *)
  53. method help : unit -> string list
  54. (** Performs the Help command. Returns the server multiline answer. *)
  55. method noop : unit -> unit
  56. (** NOOP : does nothing, keeps the connection alive. *)
  57. method quit : unit -> unit
  58. (** Requests the server to end this session. *)
  59. end
  60. (* ======================================================================
  61. * History:
  62. *
  63. * $Log$
  64. * Revision 1.2 2005/05/23 10:49:08 mad_coder
  65. * add doc to netsmtp
  66. *
  67. *
  68. *)