Giter VIP home page Giter VIP logo

email's People

Contributors

aravindavk avatar attilaolah avatar claysof avatar copyninja avatar daniil-kzn avatar ddrboxman avatar djinn avatar hebl avatar laurent22 avatar runtakun avatar schmitch avatar scorredoira avatar xiaox0321 avatar zimmski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

email's Issues

Memory Leak

Hi,

We are using below code for send email and there is some memory leak after every mail sent.

		mailCompose := email.NewHTMLMessage(strSubject, strMessage)
		
		mailCompose.From = mail.Address{Name: strSenderName, Address: strSenderEmail}
		aryTo := strings.Split(strTo, ";")
		mailCompose.To = aryTo
			
		if err := email.Send(strSMTPURL, auth, mailCompose); err != nil {
			errorHandler(err,"SendEmail : Error in send email.")
			return
		}

		mailCompose = nil

Not able to understand where is the issue. Can you just check is there any issue in my code or library for send email.

Thanks
Sandeep Kumar

Attachement and Email body

I've attempted to send an email containing both body text and an attachment, and the text never seems to show. I can do one or the other, but not both.

Only first of the Multiple attachments being sent

I have written a simple wrapper to send an email with multiple attachment:

		var m *email.Message
		if mail.Html {
			m = email.NewHTMLMessage(mail.Subject, mail.Body)
		} else {
			m = email.NewMessage(mail.Subject, mail.Body)
		}
		m.From.Address = mail.Sender
		m.From.Name = "Rein Games"
		m.To = mail.To
		m.Cc = mail.Cc

		if mail.Attachments != nil && len(mail.Attachments) > 0 {
			for _, a := range mail.Attachments {
				if a.Inline {
					m.Inline(a.FilePath)
				} else {
					m.Attach(a.FilePath)
				}
			}
		}

		auth := smtp.PlainAuth("", mail.Sender, conf.Password, "smtp.gmail.com")
		return email.Send("smtp.gmail.com:587", auth, m)

However, using this code only the first attachment is being sent with the email. The subsequent attachments do not get attached. What am I missing?

Thanks,

Attachement is empty

This might be a long shot, but I was able to use the library to attach an image and send the email, however when I download and open the attachment it says the following

The file “test.png” could not be opened because it is empty.

Here is my code, I have been debugging for awhile maybe a second set of eye can help me find the error

func sendMyEmail() {
    m := email.NewMessage("Hi", "this is the body")
    m.From = mail.Address{Name: "From", Address: "[email protected]"}
    m.To = []string{"[email protected]"}

    if err := m.Attach("./img_dump/test.png"); err != nil {
        // There is no error here
        log.Fatal(err)
    }

    auth := smtp.PlainAuth("", "[email protected]", "mypassword", "smtp.gmail.com")
    if err := email.Send("smtp.gmail.com:587", auth, m); err != nil {
         // There is no error here also
        log.Fatal(err)
    }
}

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.