@@ -42,7 +42,7 @@ func (m Model) sendEmailCmd() tea.Cmd {
4242 bcc := strings .Split (m .Bcc .Value (), ToSeparator )
4343 switch m .DeliveryMethod {
4444 case SMTP :
45- err = sendSMTPEmail (to , cc , bcc , m .From .Value (), m .Subject .Value (), m .Body .Value (), attachments )
45+ err = sendSMTPEmail (to , cc , bcc , m .From .Value (), m .Subject .Value (), m .Body .Value (), plaintext , attachments )
4646 case Resend :
4747 err = sendResendEmail (to , cc , bcc , m .From .Value (), m .Subject .Value (), m .Body .Value (), attachments )
4848 default :
@@ -63,7 +63,7 @@ const gmailSuffix = "@gmail.com"
6363const gmailSMTPHost = "smtp.gmail.com"
6464const gmailSMTPPort = 587
6565
66- func sendSMTPEmail (to , cc , bcc []string , from , subject , body string , attachments []string ) error {
66+ func sendSMTPEmail (to , cc , bcc []string , from , subject , body string , plaintext bool , attachments []string ) error {
6767 server := mail .NewSMTPClient ()
6868
6969 var err error
@@ -115,7 +115,7 @@ func sendSMTPEmail(to, cc, bcc []string, from, subject, body string, attachments
115115 html := bytes .NewBufferString ("" )
116116 convertErr := goldmark .Convert ([]byte (body ), html )
117117
118- if convertErr != nil {
118+ if ( plaintext ) || ( convertErr != nil ) {
119119 email .SetBody (mail .TextPlain , body )
120120 } else {
121121 email .SetBody (mail .TextHTML , html .String ())
0 commit comments