Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored code and added authentication parameters for SMTP. #7

Merged
merged 1 commit into from
Oct 29, 2015

Conversation

nathan-osman
Copy link
Contributor

First of all, this is a neat little Go application.

I've reorganized the code a bit in order to make things a bit clearer and simpler in some places. Some of the changes I made include:

  • using a var block to declare the flags (they now line up with go fmt)
  • using backticks in the flag descriptions (displayed beside flags when -h is used)
  • combining the flag error messages into a single message
  • moving the HTTP retrieval to a separate function, fetchPage()
  • using a map and for{} loop to generate the message headers

I also added the ability to specify a username and password when connecting to an SMTP server. These two additional flags are optional - without them, the application behaves as it did before.

@jgrahamc
Copy link
Owner

Thanks. Nice refactor.

jgrahamc added a commit that referenced this pull request Oct 29, 2015
Refactored code and added authentication parameters for SMTP.
@jgrahamc jgrahamc merged commit 3a7e5a0 into jgrahamc:master Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants