Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2023-02-28 Thread Tushar Desai
Hi,

I set a timeout of 20 sec for the Dialer, but the DialAndSend continued 
beyond the timeout and sent email after 27sec.

code:
dialer = gomail.NewDialer("smtp.mailtrap.io", 587, u, p)
dialer.Timeout = 20*time.Second

start := time.Now()
if err = dialer.DialAndSend(m); err != nil {
err = fmt.Errorf("sendEmail: sending email to %s; %s", u.email, err)
return
}
elapsed := time.Since(start)
lgr.Trace().Msgf("EML %11.6fms", float64(elapsed)/float64(time.Millisecond))


Log message:
2/28 06:41:00.325 TRC EML 27604.141065ms remote=172.19.0.1
On Friday, August 25, 2017 at 9:47:12 AM UTC+5:30 Antonio Sun wrote:

> You should break that 40s up and see how long is spent on dial, and how 
> long is spent on send. 
>
> On Thu, Aug 24, 2017 at 9:41 PM,  wrote:
>
>> Thank you very much for your reply. However, in my code, it spent 40s to 
>> send email. 
>>
>> Here is the code:
>>
>> now := time.Now()
>> msg := gomail.NewMessage()
>> //the element of msg is abridged
>> dial := gomail.Dialer{Host: "127.0.0.1", Port: 25}
>> dial.TLSConfig = {InsecureSkipVerify: true}
>> if err := dial.DialAndSend(msg); err != nil {
>> log.Fatal("failed to send email", err)
>> } else {
>> timeSpent := fmt.Sprintf("%.3f s", time.Since(now).Seconds())
>> fmt.Println("time to spend in sending email", timeSpent )
>> }
>>
>> 在 2017年8月25日星期五 UTC+8上午1:53:48,Tamás Gulácsi写道:
>>
>>> It uses a constant 10s timeout for dial. What should time out?
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/golang-nuts/jMxZHzvvEVg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> golang-nuts+unsubscr...@googlegroups.com.
>>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/80c3ebbb-ee60-4e6f-9a29-7456bb8d94ban%40googlegroups.com.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-07-08 Thread lebedevnikita12211
Hello, from Russia. It would be nice to add a function for embed and attach 
file from byte array, not just from file

среда, 2 сентября 2015 г., 14:55:26 UTC+3 пользователь Alexandre Cesaro 
написал:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4b0404a0-92c3-4558-b333-86f56916acac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-04-08 Thread code veyper
https://play.golang.org/p/lNbxCAxsqwd

here is code




On Monday, April 8, 2019 at 3:43:04 AM UTC+3, Michael Jones wrote:
>
> If those black boxes represent Go language code, please share it here by 
> pasting it into the Go Language Playground and then sharing a link in email 
> here. 
>
> It is impossible to understand these rectangles on my phone. 
>
> On Sat, Apr 6, 2019 at 11:10 PM > wrote:
>
>> hi, i use this code, I can't make it work help
>>
>> Could you tell me how to properly use your library on this code, and set 
>> an example for a custom dealer, so that I can access the smtp through a 
>> proxy (sock4, sock4a, or sock5)? is it possible? please a couple of lines 
>> of code for an example
>>
>> func main() {
>>
>>
>>ch := make(chan *gomail.Message, 10)
>>
>>// Use the channel in your program to send emails.
>>m := gomail.NewMessage()
>>m.SetHeader("From", "ifabio...@mail.bcu.ac.uk ")
>>m.SetHeader("To", "t...@mail.com")
>>
>>//m.SetAddressHeader("Cc", "d...@example.com ", "Dan")
>>m.SetHeader("Subject", "Hello!")
>>m.SetBody("text/html", "Hello Bob and Cora!")
>>//m.Attach("/home/Alex/lolcat.jpg")
>>
>>ch <- m
>>
>>go func() {
>>   d := gomail.NewDialer("smtp-mail.outlook.com", 587, 
>> "ifabio...@mail.bcu.ac.uk ", "pwd")
>>
>>   var s gomail.SendCloser
>>
>>   var err error
>>   open := false
>>   for {
>>  select {
>>  case m, ok := <-ch:
>> if !ok {
>>return
>> }
>> if !open {
>>if s, err = d.Dial(); err != nil {
>>   panic(err)
>>}
>>open = true
>> }
>> if err := gomail.Send(s, m); err != nil {
>>log.Print(err)
>> }
>>  // Close the connection to the SMTP server if no email was sent in
>>  // the last 30 seconds.
>>  case <-time.After(30 * time.Second):
>> if open {
>>if err := s.Close(); err != nil {
>>   panic(err)
>>}
>>open = false
>> }
>>  }
>>   }
>>}()
>>
>> }
>>
>>
>>
>>
>>// Close the channel to stop the mail daemon.
>>close(ch)
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golan...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
> -- 
>
> *Michael T. jonesmichae...@gmail.com *
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-04-07 Thread Michael Jones
If those black boxes represent Go language code, please share it here by
pasting it into the Go Language Playground and then sharing a link in email
here.

It is impossible to understand these rectangles on my phone.

On Sat, Apr 6, 2019 at 11:10 PM  wrote:

> hi, i use this code, I can't make it work help
>
> Could you tell me how to properly use your library on this code, and set
> an example for a custom dealer, so that I can access the smtp through a
> proxy (sock4, sock4a, or sock5)? is it possible? please a couple of lines
> of code for an example
>
> func main() {
>
>
>ch := make(chan *gomail.Message, 10)
>
>// Use the channel in your program to send emails.
>m := gomail.NewMessage()
>m.SetHeader("From", "ifabion.bai...@mail.bcu.ac.uk")
>m.SetHeader("To", "t...@mail.com")
>
>//m.SetAddressHeader("Cc", "d...@example.com", "Dan")
>m.SetHeader("Subject", "Hello!")
>m.SetBody("text/html", "Hello Bob and Cora!")
>//m.Attach("/home/Alex/lolcat.jpg")
>
>ch <- m
>
>go func() {
>   d := gomail.NewDialer("smtp-mail.outlook.com", 587, 
> "ifabion.bai...@mail.bcu.ac.uk", "pwd")
>
>   var s gomail.SendCloser
>
>   var err error
>   open := false
>   for {
>  select {
>  case m, ok := <-ch:
> if !ok {
>return
> }
> if !open {
>if s, err = d.Dial(); err != nil {
>   panic(err)
>}
>open = true
> }
> if err := gomail.Send(s, m); err != nil {
>log.Print(err)
> }
>  // Close the connection to the SMTP server if no email was sent in
>  // the last 30 seconds.
>  case <-time.After(30 * time.Second):
> if open {
>if err := s.Close(); err != nil {
>   panic(err)
>}
>open = false
> }
>  }
>   }
>}()
>
> }
>
>
>
>
>// Close the channel to stop the mail daemon.
>close(ch)
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-- 

*Michael T. jonesmichael.jo...@gmail.com *

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-04-07 Thread axllowlord
hi, i use this code, I can't make it work help

Could you tell me how to properly use your library on this code, and set an 
example for a custom dealer, so that I can access the smtp through a proxy 
(sock4, sock4a, or sock5)? is it possible? please a couple of lines of code 
for an example

func main() {

   
   ch := make(chan *gomail.Message, 10)

   // Use the channel in your program to send emails.
   m := gomail.NewMessage()
   m.SetHeader("From", "ifabion.bai...@mail.bcu.ac.uk")
   m.SetHeader("To", "t...@mail.com")

   //m.SetAddressHeader("Cc", "d...@example.com", "Dan")
   m.SetHeader("Subject", "Hello!")
   m.SetBody("text/html", "Hello Bob and Cora!")
   //m.Attach("/home/Alex/lolcat.jpg")

   ch <- m

   go func() {
  d := gomail.NewDialer("smtp-mail.outlook.com", 587, 
"ifabion.bai...@mail.bcu.ac.uk", "pwd")

  var s gomail.SendCloser

  var err error
  open := false
  for {
 select {
 case m, ok := <-ch:
if !ok {
   return
}
if !open {
   if s, err = d.Dial(); err != nil {
  panic(err)
   }
   open = true
}
if err := gomail.Send(s, m); err != nil {
   log.Print(err)
}
 // Close the connection to the SMTP server if no email was sent in
 // the last 30 seconds.
 case <-time.After(30 * time.Second):
if open {
   if err := s.Close(); err != nil {
  panic(err)
   }
   open = false
}
 }
  }
   }()

}




   // Close the channel to stop the mail daemon.
   close(ch)



-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2018-04-10 Thread leeas via golang-nuts
Is there a way to send an email AS a group member? Currently, I am able to 
do so via the Gmail Web Client. But I can't figure out a way to do it via 
my 3rd party client (Airmail 3), or standard Go (via net/smtp).

Hence, I was wondering if there was a way to send as a group.

On Wednesday, September 2, 2015 at 6:55:26 AM UTC-5, Alexandre Cesaro wrote:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-28 Thread yhj772709
Thanks very much.

But, what I mean of setting timeout is giving up this sending, and try to 
send another email


在 2017年8月29日星期二 UTC+8上午9:59:24,Antonio Sun写道:
>
>
>
> On Sun, Aug 27, 2017 at 10:31 PM,  wrote:
>
>>
>> Without setting timeout on sending, it spent 5 minutes to send an email. 
>> Badly, it will hang up, then cause bug on production.
>>
>
> That means the mail server is busy. Setting shorter timeout will 
> stress mail server even more and make things worse for everyone. 
>
> The proper way is wait, and retry (dialing), with each retry waiting twice 
> as long as before. So even if the remote mail server is down for a few 
> hours, you email can still go through eventually. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-28 Thread Antonio Sun
On Sun, Aug 27, 2017 at 10:31 PM,  wrote:

>
> Without setting timeout on sending, it spent 5 minutes to send an email.
> Badly, it will hang up, then cause bug on production.
>

That means the mail server is busy. Setting shorter timeout will
stress mail server even more and make things worse for everyone.

The proper way is wait, and retry (dialing), with each retry waiting twice
as long as before. So even if the remote mail server is down for a few
hours, you email can still go through eventually.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread Antonio Sun
You should break that 40s up and see how long is spent on dial, and how
long is spent on send.

On Thu, Aug 24, 2017 at 9:41 PM,  wrote:

> Thank you very much for your reply. However, in my code, it spent 40s to
> send email.
>
> Here is the code:
>
> now := time.Now()
> msg := gomail.NewMessage()
> //the element of msg is abridged
> dial := gomail.Dialer{Host: "127.0.0.1", Port: 25}
> dial.TLSConfig = {InsecureSkipVerify: true}
> if err := dial.DialAndSend(msg); err != nil {
> log.Fatal("failed to send email", err)
> } else {
> timeSpent := fmt.Sprintf("%.3f s", time.Since(now).Seconds())
> fmt.Println("time to spend in sending email", timeSpent )
> }
>
> 在 2017年8月25日星期五 UTC+8上午1:53:48,Tamás Gulácsi写道:
>
>> It uses a constant 10s timeout for dial. What should time out?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/golang-nuts/jMxZHzvvEVg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread yhj772709
Thank you very much for your reply. However, in my code, it spent 40s to 
send email. 

Here is the code:

now := time.Now()
msg := gomail.NewMessage()
//the element of msg is abridged
dial := gomail.Dialer{Host: "127.0.0.1", Port: 25}
dial.TLSConfig = {InsecureSkipVerify: true}
if err := dial.DialAndSend(msg); err != nil {
log.Fatal("failed to send email", err)
} else {
timeSpent := fmt.Sprintf("%.3f s", time.Since(now).Seconds())
fmt.Println("time to spend in sending email", timeSpent )
}

在 2017年8月25日星期五 UTC+8上午1:53:48,Tamás Gulácsi写道:
>
> It uses a constant 10s timeout for dial. What should time out?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread Tamás Gulácsi
It uses a constant 10s timeout for dial. What should time out?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread yhj772709
Hi, 
Could you show me a method to set timeout when send a email?
Regards.

在 2015年9月2日星期三 UTC+8下午7:55:26,Alexandre Cesaro写道:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-06-11 Thread Tamás Gulácsi
What do you mean by "lots of tedious manual works"?
You have to specify where shall those emails appear, (embed `` into the body),
or you can just Attach those files to the email.

 
2017. június 11., vasárnap 16:47:54 UTC+2 időpontban Antonio Sun a 
következőt írta:
>
> Hey Alex,
>
> Can gomail supports embedding *a lot* of images?
>
> From
> https://godoc.org/gopkg.in/gomail.v2#Message.Embed
> it seems that gomail only support embedding one image, if we embed a lot 
> of them, there are still lots of tedious manual works to make it works. 
>
> Right?
>
>
> On Monday, May 30, 2016 at 9:41:28 PM UTC-4, Tong Sun wrote:
>>
>> Nice Alexandre. 
>>
>> Can Gomail  send email using SSL 
>> but not TLS? I.e., basically doing this:
>> https://gist.github.com/chrisgillis/10888032
>>
>> Could you show me how to do it please? I looked at 
>> https://godoc.org/gopkg.in/gomail.v2, but haven't figured out the way. I 
>> also found a historic message with this:
>>
>>  d := gomail.Dialer{Host: "localhost", Port: 587, SSL: false, TLSConfig: nil}
>>
>>
>> but it doesn't work (and there is no answer either). 
>>
>> Please help. 
>> Thanks
>>
>> On Wednesday, September 2, 2015 at 7:55:26 AM UTC-4, Alexandre Cesaro 
>> wrote:
>>>
>>> Hi,
>>>
>>> I just released the second version of Gomail 
>>> .
>>>
>>> There are quite a few backward-incompatible changes 
>>>  since 
>>> Gomail v1 but it brings lots of good stuff:
>>>
>>>- A great focus was placed on performances. Gomail v2 is way more 
>>>efficient than Gomail v1 to send a large number of emails (see the 
>>>Daemon  
>>>or Newsletter 
>>> 
>>>examples).
>>>- The API is now clearer and way more flexible.
>>>- The documentation  improved 
>>>and many examples were added.
>>>- All existing issues have been closed.
>>>- The minimum Go version is now 1.2 instead of 1.3. No external 
>>>dependencies are used with Go 1.5.
>>>
>>> More info on Github: https://github.com/go-gomail/gomail
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-06-11 Thread antoniosun001
Hey Alex,

Can gomail supports embedding *a lot* of images?

From
https://godoc.org/gopkg.in/gomail.v2#Message.Embed
it seems that gomail only support embedding one image, if we embed a lot of 
them, there are still lots of tedious manual works to make it works. 

Right?


On Monday, May 30, 2016 at 9:41:28 PM UTC-4, Tong Sun wrote:
>
> Nice Alexandre. 
>
> Can Gomail  send email using SSL but 
> not TLS? I.e., basically doing this:
> https://gist.github.com/chrisgillis/10888032
>
> Could you show me how to do it please? I looked at 
> https://godoc.org/gopkg.in/gomail.v2, but haven't figured out the way. I 
> also found a historic message with this:
>
>  d := gomail.Dialer{Host: "localhost", Port: 587, SSL: false, TLSConfig: nil}
>
>
> but it doesn't work (and there is no answer either). 
>
> Please help. 
> Thanks
>
> On Wednesday, September 2, 2015 at 7:55:26 AM UTC-4, Alexandre Cesaro 
> wrote:
>>
>> Hi,
>>
>> I just released the second version of Gomail 
>> .
>>
>> There are quite a few backward-incompatible changes 
>>  since 
>> Gomail v1 but it brings lots of good stuff:
>>
>>- A great focus was placed on performances. Gomail v2 is way more 
>>efficient than Gomail v1 to send a large number of emails (see the 
>>Daemon  
>>or Newsletter 
>> 
>>examples).
>>- The API is now clearer and way more flexible.
>>- The documentation  improved 
>>and many examples were added.
>>- All existing issues have been closed.
>>- The minimum Go version is now 1.2 instead of 1.3. No external 
>>dependencies are used with Go 1.5.
>>
>> More info on Github: https://github.com/go-gomail/gomail
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-06-01 Thread connelblaze
Hey Alex, tried sending mail with gomail v2 having some ish.
here is my code:

func contact(w http.ResponseWriter, req *http.Request) {
   var s string
   var e string
   var m string
   pd := pageData{
  Title: "contact || CACCYE",
   }
   if req.Method == http.MethodPost {
  s = req.FormValue("subject")
  e = req.FormValue("mail")
  m = req.FormValue("message")

  pd.subject = s
  pd.email = e
  pd.msg = m

  cb := gomail.NewMessage()
  cb.SetHeader("From", e)
  cb.SetHeader("To", "his_m...@gmail.com", "her_m...@gmail.com")
  cb.SetHeader("Subject", s)
  cb.SetBody("text/plain", m)

  d := gomail.NewDialer("smtp.gmail.com", 587, "my_m...@gmail.com", 
"my_password")

  // Send the email to Bob, Cora and Dan.
  if err := d.DialAndSend(cb); err != nil {
 panic(err)
  }
   }

   err := tpl.ExecuteTemplate(w, "contact.gohtml", pd)
   if err != nil {
  log.Println(err)
   }
}


when i submit it outputs:
2017/06/01 19:28:48 http: panic serving [::1]:50340: dial tcp: i/o timeout
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc42008c6e0)
/usr/local/go/src/net/http/server.go:1721 +0xd0
panic(0x709800, 0xc4200165a0)
/usr/local/go/src/runtime/panic.go:489 +0x2cf
main.contact(0x8b6740, 0xc42013e2a0, 0xc42000ae00)
/home/connelblaze/go/src/github.com/connelevalsam/GoWebDev/001/src/sendmail/src/main/main.go:86
 
+0x5d3
net/http.HandlerFunc.ServeHTTP(0x769658, 0x8b6740, 0xc42013e2a0, 
0xc42000ae00)
/usr/local/go/src/net/http/server.go:1942 +0x44
net/http.(*ServeMux).ServeHTTP(0x8e38e0, 0x8b6740, 0xc42013e2a0, 
0xc42000ae00)
/usr/local/go/src/net/http/server.go:2238 +0x130
net/http.serverHandler.ServeHTTP(0xc42011e0b0, 0x8b6740, 0xc42013e2a0, 
0xc42000ae00)
/usr/local/go/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc42008c6e0, 0x8b6d40, 0xc420018680)
/usr/local/go/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2668 +0x2ce
2017/06/01 19:28:54 http: panic serving [::1]:50370: 534 5.7.14 
 Please log in via your web browser and
5.7.14 then try again.
5.7.14  Learn more at
5.7.14  https://support.google.com/mail/answer/78754 w11sm13739759eda.63 - 
gsmtp
goroutine 33 [running]:
net/http.(*conn).serve.func1(0xc4201361e0)
/usr/local/go/src/net/http/server.go:1721 +0xd0
panic(0x6fb7a0, 0xc42043f8e0)
/usr/local/go/src/runtime/panic.go:489 +0x2cf
main.contact(0x8b6740, 0xc4201442a0, 0xc420100b00)
/home/connelblaze/go/src/github.com/connelevalsam/GoWebDev/001/src/sendmail/src/main/main.go:86
 
+0x5d3
net/http.HandlerFunc.ServeHTTP(0x769658, 0x8b6740, 0xc4201442a0, 
0xc420100b00)
/usr/local/go/src/net/http/server.go:1942 +0x44
net/http.(*ServeMux).ServeHTTP(0x8e38e0, 0x8b6740, 0xc4201442a0, 
0xc420100b00)
/usr/local/go/src/net/http/server.go:2238 +0x130
net/http.serverHandler.ServeHTTP(0xc42011e0b0, 0x8b6740, 0xc4201442a0, 
0xc420100b00)
/usr/local/go/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4201361e0, 0x8b6d40, 0xc4200f2d40)
/usr/local/go/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2668 +0x2ce


hope to hear from you

On Wednesday, September 2, 2015 at 12:55:26 PM UTC+1, Alexandre Cesaro 
wrote:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 

[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-04-13 Thread emilyvyomahallaway . shiva
Hi Alexandre
I tried sending an email using the server settings from my outlook mailbox 
and got this error - Could you shed some light as to what this could be 
about? 

panic: read tcp 10.18.32.66:59347->10.12.137.20:3268: read: connection 
reset by peer


goroutine 1 [running]:

panic(0x1aaf80, 0xc420014460)

/usr/local/Cellar/go/1.7.4_2/libexec/src/runtime/panic.go:500 +0x1a1

main.main()



On Wednesday, September 2, 2015 at 4:55:26 AM UTC-7, Alexandre Cesaro wrote:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-12-27 Thread Michael Jones
*post hoc, ergo propter hoc*

On Tue, Dec 27, 2016 at 12:21 AM,  wrote:

> ALERT - After implementing Gomail v2 started getting lots of SPAM
> messages that ever received in Inbox.
>
>
> On Wednesday, September 2, 2015 at 5:25:26 PM UTC+5:30, Alexandre Cesaro
> wrote:
>>
>> Hi,
>>
>> I just released the second version of Gomail
>> .
>>
>> There are quite a few backward-incompatible changes
>>  since
>> Gomail v1 but it brings lots of good stuff:
>>
>>- A great focus was placed on performances. Gomail v2 is way more
>>efficient than Gomail v1 to send a large number of emails (see the
>>Daemon 
>>or Newsletter
>>
>>examples).
>>- The API is now clearer and way more flexible.
>>- The documentation  improved
>>and many examples were added.
>>- All existing issues have been closed.
>>- The minimum Go version is now 1.2 instead of 1.3. No external
>>dependencies are used with Go 1.5.
>>
>> More info on Github: https://github.com/go-gomail/gomail
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Michael T. Jones
michael.jo...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-12-27 Thread dipen . modi
ALERT - After implementing Gomail v2 started getting lots of SPAM messages 
that ever received in Inbox. 


On Wednesday, September 2, 2015 at 5:25:26 PM UTC+5:30, Alexandre Cesaro 
wrote:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-08-10 Thread matic
GitHub page says "Automatic encoding of special characters". Does that mean 
if I use output from (user provided input to a 
golang.org/pkg/text/template) as body input to gomail, gomail will properly 
escape any characters that could be used to insert SMTP headers or do 
anything else that could be malicious?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2016-06-24 Thread Bernard LEGAUT
I recently switch from go 1.5.1 to go 1.6, and gomail seems to get in 
trouble. 

Anyone with the same issue ?

Thanks,





On Wednesday, September 2, 2015 at 8:55:26 AM UTC-3, Alexandre Cesaro wrote:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.