diff --git a/header.go b/header.go index 42ec928..e5c2cec 100644 --- a/header.go +++ b/header.go @@ -106,6 +106,22 @@ func (i Importance) NumString() string { } } +// XPrioString returns the X-Priority number string based on the Importance +func (i Importance) XPrioString() string { + switch i { + case ImportanceNonUrgent: + return "5" + case ImportanceLow: + return "5" + case ImportanceHigh: + return "1" + case ImportanceUrgent: + return "1" + default: + return "" + } +} + // String returns the importance string based on the Importance func (i Importance) String() string { switch i { diff --git a/msg.go b/msg.go index e17fc33..2b391b6 100644 --- a/msg.go +++ b/msg.go @@ -308,7 +308,7 @@ func (m *Msg) SetImportance(i Importance) { } m.SetHeader(HeaderImportance, i.String()) m.SetHeader(HeaderPriority, i.NumString()) - m.SetHeader(HeaderXPriority, i.NumString()) + m.SetHeader(HeaderXPriority, i.XPrioString()) m.SetHeader(HeaderXMSMailPriority, i.NumString()) }