@ -31,11 +31,11 @@ type Message struct {
}
}
// NewMessageFrom creates new mail message object with custom From header.
// NewMessageFrom creates new mail message object with custom From header.
func NewMessageFrom ( to [ ] string , from , subject , body string ) * Message {
func NewMessageFrom ( to [ ] string , fromDisplayName , fromAddress , subject , body string ) * Message {
log . Trace ( "NewMessageFrom (body):\n%s" , body )
log . Trace ( "NewMessageFrom (body):\n%s" , body )
msg := gomail . NewMessage ( )
msg := gomail . NewMessage ( )
msg . SetHeader ( "From" , from )
msg . SetAddress Header ( "From" , fromAddress , fromDisplayName )
msg . SetHeader ( "To" , to ... )
msg . SetHeader ( "To" , to ... )
msg . SetHeader ( "Subject" , subject )
msg . SetHeader ( "Subject" , subject )
msg . SetDateHeader ( "Date" , time . Now ( ) )
msg . SetDateHeader ( "Date" , time . Now ( ) )
@ -58,7 +58,7 @@ func NewMessageFrom(to []string, from, subject, body string) *Message {
// NewMessage creates new mail message object with default From header.
// NewMessage creates new mail message object with default From header.
func NewMessage ( to [ ] string , subject , body string ) * Message {
func NewMessage ( to [ ] string , subject , body string ) * Message {
return NewMessageFrom ( to , setting . MailService . From , subject , body )
return NewMessageFrom ( to , setting . MailService . FromName , setting . MailService . FromEmail , subject , body )
}
}
type loginAuth struct {
type loginAuth struct {