title: smtp.SendMail fails after 10 minutes with EOF
body: <p>I'm trying to send mail via the standard library SMTP package and it does nothing for exactly 10 minutes and then fails with an unhelpful End of File error I can't make sense of.</p>
  
  <pre><code>// excerpt from the calling function
  // --- snip ---
  if e := mailNotify(board, validPosts, ipMinusPort, delTime); e != nil {
      errorPage(w, tmpl, "Contact Administrator",
          "Email notification failed, please contact archive admin.")
      log.Println("ERROR: Failed to send notification email: " + e.Error())
  }
  // --- snip ---
  
  func mailNotify(board *config.Board, validPosts []int64, 
                          ip string, delTime time.Time) error {
  
      addresses := strings.Split(board.NotifyAddr, ",")
      if len(addresses) &lt; 1 {
          return nil
      }
  
      msg := new(bytes.Buffer)
      type values struct {
          IP      string
          Posts   []int64
          DelTime time.Time
      }
      t.ExecuteTemplate(msg, "post_reported", &amp;values{ip, validPosts, delTime})
      auth:= smtp.PlainAuth("", board.NotifyAddr, board.NotifyPass,
          strings.Split(board.SMTPServer, ":")[0])
      return smtp.SendMail(board.SMTPServer, auth,
          board.FromEmail, addresses, msg.Bytes())
  }
  </code></pre>
  
  <p>The exact message that gets logged is:</p>
  
  <blockquote>
    <p>2012/07/25 22:57:58 ERROR: Failed to send notification email: EOF</p>
  </blockquote>
  
  <p>I've <code>log.Printf</code> debugged this function and verified the values being sent at this point are valid. The email address is a real address on gmail.com and the password is correct, and <code>board.SMTPServer</code> is <code>smtp.googlemail.com:465</code>. I've tried storing the result of msg.Bytes() in a separate variable and taking the length to be sure that it was producing an byte array to send, and the length is indeed non-zero. I'm guessing the EOF is bubbling up from somwhere deeper in the standard library than the SendMail function itself, but I have no idea where it's choking and I don't know what I did to upset it.</p>