Module net.smtp stdlib

net.smtp
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
6
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct Client

pub struct Client {
mut:
	conn     net.TcpConn
	ssl_conn &ssl.SSLConn = unsafe { nil }
	reader   io.BufferedReader
pub:
	server   string
	port     int = 25
	username string
	password string
	from     string
	ssl      bool
	starttls bool
pub mut:
	is_open   bool
	encrypted bool
}

#fn new_client

fn new_client(config Client) !&Client

new_client returns a new SMTP client and connects to it

#fn (&Client) reconnect

fn (mut c &Client) reconnect() !

reconnect reconnects to the SMTP server if the connection was closed

#fn (&Client) send

fn (mut c &Client) send(config Mail) !

send sends an email

#fn (&Client) quit

fn (mut c &Client) quit() !

quit closes the connection to the server

#fn (&Client) connect_ssl

fn (mut c &Client) connect_ssl() !

#fn (&Client) expect_reply

fn (mut c &Client) expect_reply(expected ReplyCode) !

expect_reply checks if the SMTP server replied with the expected reply code

#fn (&Client) send_str

inline
fn (mut c &Client) send_str(s string) !

#fn (&Client) send_ehlo

inline
fn (mut c &Client) send_ehlo() !

#fn (&Client) send_starttls

inline
fn (mut c &Client) send_starttls() !

#fn (&Client) send_auth

inline
fn (mut c &Client) send_auth() !

#fn (&Client) send_mailfrom

fn (mut c &Client) send_mailfrom(from string) !

#fn (&Client) send_mailto

fn (mut c &Client) send_mailto(to string) !

#fn (&Client) send_data

fn (mut c &Client) send_data() !

#fn (&Client) send_body

fn (mut c &Client) send_body(cfg Mail) !

#struct Mail

pub struct Mail {
	from      string
	to        string
	cc        string
	bcc       string
	date      time.Time = time.now()
	subject   string
	body_type BodyType
	body      string
}

Interfaces

This section is empty.

Enums

#enum BodyType

pub enum BodyType {
	text
	html
}