Skip to content
/ ews Public

quick and dirty Go package to send emails via Exchange using EWS instead of SMTP

License

Notifications You must be signed in to change notification settings

andlabs/ews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

very dumb, hacky, possibly flaky package to send emails from an Exchange server via EWS (in the event yours doesn't expose a SMTP server)

usage:

	b, err := ews.BuildTextEmail(
		"me@server.com",
		[]string{"friend@example.com", "someone@else.com"},
		"An email subject",
		[]byte("The email body, as plain text"))
	if err != nil {
		// handle err
	}
	resp, err := ews.Issue(
		"https://exhange.server.com/ews/Exchange.asmx",
		"domain\\username",
		"password",
		b)
	if err != nil {
		// handle err
	}
	if resp.StatusCode != 200 {
		// read body and figure out what happened
	}
	// read or ignore body; the email was sent

the other exported types are just the raw data structures for the request XML; you can ignore them

I'm not sure if I'll develop this further; feel free to (warning: here be SOAP)
some resources I used are in comments in the code

TODOs
- figure out why UTF-8 isn't used for email bodies, or how to force the encoding

About

quick and dirty Go package to send emails via Exchange using EWS instead of SMTP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages