Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8353713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:20:30+00:00 2026-06-09T09:20:30+00:00

I’m trying to send mail via the standard library SMTP package and it does

  • 0

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.

// 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) < 1 {
        return nil
    }

    msg := new(bytes.Buffer)
    type values struct {
        IP      string
        Posts   []int64
        DelTime time.Time
    }
    t.ExecuteTemplate(msg, "post_reported", &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())
}

The exact message that gets logged is:

2012/07/25 22:57:58 ERROR: Failed to send notification email: EOF

I’ve log.Printf 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 board.SMTPServer is smtp.googlemail.com:465. 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:20:32+00:00Added an answer on June 9, 2026 at 9:20 am

    Gmail’s port 465 is for connecting via TLS, but SendMail expects plain old TCP. Try connecting to port 587 instead. SendMail will upgrade to TLS automatically when it’s available (which it is in this case).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.