@@ -71,7 +71,7 @@ func (service *Service) Send(message string, params *types.Params) error {
71
71
return fail (FailApplySendParams , err )
72
72
}
73
73
74
- client , err := getClientConnection (service . config )
74
+ client , err := getClientConnection (& config )
75
75
if err != nil {
76
76
return fail (FailGetSMTPClient , err )
77
77
}
@@ -206,7 +206,7 @@ func (service *Service) sendToRecipient(client *smtp.Client, toAddress string, c
206
206
return fail (FailOpenDataStream , err )
207
207
}
208
208
209
- if err := writeHeaders (wc , service .getHeaders (toAddress , config . Subject )); err != nil {
209
+ if err := writeHeaders (wc , service .getHeaders (toAddress , config )); err != nil {
210
210
return err
211
211
}
212
212
@@ -228,9 +228,7 @@ func (service *Service) sendToRecipient(client *smtp.Client, toAddress string, c
228
228
return nil
229
229
}
230
230
231
- func (service * Service ) getHeaders (toAddress string , subject string ) map [string ]string {
232
- conf := service .config
233
-
231
+ func (service * Service ) getHeaders (toAddress string , conf * Config ) map [string ]string {
234
232
var contentType string
235
233
if conf .UseHTML {
236
234
contentType = fmt .Sprintf (contentMultipart , service .multipartBoundary )
@@ -239,7 +237,7 @@ func (service *Service) getHeaders(toAddress string, subject string) map[string]
239
237
}
240
238
241
239
return map [string ]string {
242
- "Subject" : subject ,
240
+ "Subject" : conf . Subject ,
243
241
"Date" : time .Now ().Format (time .RFC1123Z ),
244
242
"To" : toAddress ,
245
243
"From" : fmt .Sprintf ("%s <%s>" , conf .FromName , conf .FromAddress ),
0 commit comments