Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dfss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcs
dfss
Merge requests
!5
115 mails lib
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
115 mails lib
115_mails_lib
into
master
Overview
14
Commits
1
Pipelines
0
Changes
Merged
Dauchy Quentin
requested to merge
115_mails_lib
into
master
9 years ago
Overview
14
Commits
1
Pipelines
0
Changes
-
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
c27359ab
1 commit,
9 years ago
+
364
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
Search (e.g. *.vue) (Ctrl+P)
mails/README.md
0 → 100644
+
45
−
0
Options
### DFSS - Mails lib ###
This library is designed to wrap the smtp library of go.
## Initiating a connection to a server ##
To start a connection to a server, create a CustomClient via NewCustomClient
This takes :
- A sender (ex : qdauchy@insa-rennes.fr)
- A host (ex : mailhost.insa-rennes.fr)
- A port (ex : 587)
- A user (ex : qdauchy)
- A password
This requires the server to have TLS
## Using the connection ##
The connection that has been created can then be used to send one or several mails
Using Send requires :
- A slice of receivers
- A subject
- A message
- A (possibly empty) slice of extensions
- A (possibly empty) slice of filenames. This slice must be of the same length as the extensions one.
## Closing the connection ##
Finally, close the connection using Close.
## Example ###
Refer to the doc's to see the library in practice
## Testing the library ##
The testing file uses the following variables to set up the tests :
DFSS_TEST_MAIL_SENDER
DFSS_TEST_MAIL_HOST
DFSS_TEST_MAIL_PORT
DFSS_TEST_MAIL_USER
DFSS_TEST_MAIL_PASSWORD
DFSS_TEST_MAIL_RCPT1
DFSS_TEST_MAIL_RCPT2
Loading