Questions tagged [gomail]

gomail provides a simple interface to compose emails and to mail them efficiently in golang.

gomail provides a simple interface to compose emails and to mail them efficiently in the Go programming language.

23 questions
7
votes
2 answers

Golang multiple recipients with gomail.v2

The only way that I've used to send emails via gomail.v2 is using the Send() function to each email in a for loop. But I need to show the other email addresses those the same email have been sent. for _, recipient := range os.Args[3:] { …
Khazs
  • 73
  • 2
  • 4
3
votes
1 answer

How to set reply-to email address using gomail

I am trying to send email using gomail, need to set reply-to email address. Searched a lot but did not get any relevant link. package main import "gopkg.in/gomail.v2" func main() { m := gomail.NewMessage() m.SetAddressHeader("From",…
Yash Goel
  • 530
  • 1
  • 6
  • 15
2
votes
1 answer

how can i detect net smtp authenticate error in golang?

i am using gopkg.in/mail.v2 for sending email and i want to detect authenticate error for some reasons. i want something like this: if err := d.DialAndSend(m); err != nil { if errors.As(err, net.AuthenticateError{}) { //do…
2
votes
1 answer

Gomail v2 dial tcp: i/o timeout

i'm using gomail v2 to send email to my member and then using docker to run my service. but when i hit the api that host my sendemail function i get this error dial tcp: i/o timeout here's my code func (cc *UserController) ForgetPassword(ctx…
2
votes
2 answers

Send emails in go through Exim (without smtp)?

I'm currently using "gopkg.in/gomail.v2" to send email with following code found here package main import ( "bytes" "fmt" "gopkg.in/gomail.v2" ) func main() { m := gomail.NewMessage() m.SetHeader("From", "me@example.com") …
Garvit Jain
  • 1,862
  • 2
  • 19
  • 27
2
votes
1 answer

Gomail.v2 - Multiple recipiens from Slice

Disclaimer: I have seen a similar question in this thread: Golang multiple recipients with gomail.v2 but cannot get this to work, and do not yet have the juice to comment there asking for help. The op in that question is using os.Args[], whereas I…
gpanda
  • 785
  • 2
  • 10
  • 23
1
vote
0 answers

golang gomail SMTP error: An existing connection was forced to be terminated by the remote host

I'm making a email send package using: "gopkg.in/gomail.v2" So I create a file and the call it Everything work fine. The config is loaded fine but when i tried to send the email i get this erro: "An existing connection was forced to be terminated by…
1
vote
0 answers

Golang gomail send email with PDF as attachment with AWS SES

I am trying to use gomail to send raw message via AWS's SES (Simple Email Service). In the email, I have to attach a PDF file as attachment. Currently, I am able to receive my email and see the contents and that there's an attached pdf file.…
1
vote
1 answer

How to apply the CSS style in a Gomail library?

I am successfully sending the email to the user using the Gomail library. I have used a separate template for the HTML file and converted the HTML code into text using the html2text library for it but the problem is that it is showing the text only…
1
vote
0 answers

SMTP can send reply mail?

I using golang with emersion/go-smtp and gomail to send mail. It working fine to send email to account. But I have some problem I cannot send email with reply that email who send to me. For example, A(Sender) send mail to B(Me) I can get messageID…
Rawit_S
  • 43
  • 6
1
vote
1 answer

template: is an incomplete or empty template

I have a following piece of code in which i am trying to send an email using gopkg.in/gomail.v2. I am perfectly able to send the email when the email template is placed in the root directory of the project like this ./ main.go …
Ahmed Nawaz Khan
  • 1,451
  • 3
  • 20
  • 42
1
vote
1 answer

How to set send-as email address using gomail

I am trying to send email using gomail and need to set the send-as emailed address. I found the link to set the reply-to address, which is close, but not exactly what I'm looking for. Send-as is a function that I know GMail supports, others prob do…
0
votes
1 answer

Go-Mail multiple recipients and attachment

I am trying to make an email service using go-mail library and made it working. However there are few challenges that i am unable to solve I have the struct for form data- type SendMailBody struct { EmailTo []string `form:"sendTo"` Subject…
Krawly
  • 67
  • 6
0
votes
1 answer

how can i attach mp4 filles to mail with golang (i'm using gomail)

Here is th code: func sendMail() error{ m := gomail.NewMessage() m.SetHeader("From", From) m.SetHeader("To", "bacobas.f@gmail.com") m.SetHeader("Subject", "Hello!") m.SetBody("text/html", "Hello Bob and…
0
votes
1 answer

How to send an attachment from memory using gomail?

I want to send a CSV attachment without saving the attached data to a hard drive first. I'm using gomail throughout my code. How can I attach data directly from memory using gomail?
nobody
  • 1,144
  • 1
  • 10
  • 20
1
2