erich.wanker Posted November 24, 2015 Share Posted November 24, 2015 Hello.. i send eMails via UniGUI-app ... but the FONT of the html-mail is allways "TimesNewRomean" - the client machine is a Win8 with Outlook and all neccesary fonts installed... In UniHTMLMemo1 - i use: function afterrender(sender, eOpts) { sender.textareaEl.setStyle("font-family","Arial"); } to send the Mail i use: begin try IdSMTP := TIdSMTP.Create(nil); idSMTP.Username :='xxxx@xxx.at'; idSMTP.Password :='xxxxx'; idSMTP.Host :='smtp.xxxx'; idSMTP.Port :=25; Msg := TIdMessage.Create(nil); Msg.From.address :='wanker@xxxx'; Msg.Recipients.EMailAddresses := uniedit1.Text; Msg.CCList.EMailAddresses := uniedit4.Text; Msg.BccList.EMailAddresses := uniedit3.Text; Msg.Subject:= uniedit2.Text; Msg.ContentType := 'multipart/mixed'; Msg.ClearBody; while not FileExists( mainform.attachement) do begin sleep(1000); end; TIdAttachmentFile.Create(Msg.MessageParts, mainform.attachement); if UniHTMLMemo1.Lines.Text <> '' then begin HtmPart := TIdText.Create(Msg.MessageParts, nil ); HtmPart.ContentType := 'text/html'; htmpart.Body:=UniHTMLMemo1.Lines; <----- !!!!!!!!! end; try idSMTP.Connect(); idSMTP.Send(Msg); ShowMessage('Message Sent -> ok'); except on e:Exception do ShowMessage('Message Error -> '+e.message); end; finally if idSMTP.Connected then idSMTP.Disconnect(); IdSMTP.Free; HtmPart.Free; Msg.MessageParts.Clear; Msg.Free; end; close; end; What have i forgotten? ;-) ThanX for help Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted November 25, 2015 Share Posted November 25, 2015 What ist the content of "UniHTMLMemo1.Lines.Text"? I think it has no font selection and it is not a "complete" HTML. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.