I created the new sample project where I shown how you may create the .eml file from your code using SMMsg suite:
uses SMMsg, SMMSGTags;
procedure TfrmMain.btnCreateEMLClick(Sender: TObject);
var
eml: TSMEMLFile;
begin
eml := TSMEMLFile.Create(Self);
try
eml.Properties.AddTypedValue(PR_SENT_REPRESENTING_EMAIL_ADDRESS, '[email protected]');
eml.Properties.AddTypedValue(PR_RCVD_REPRESENTING_EMAIL_ADDRESS, '[email protected]');
eml.Properties.AddTypedValue(PR_CLIENT_SUBMIT_TIME, Now());
// eml.Properties.AddTypedValue(PR_MESSAGE_CODEPAGE, 1251);
eml.Properties.AddTypedValue(PR_SUBJECT, 'Subject');
eml.Properties.AddTypedValue(PR_BODY,
'Hello,'#13#10+
#13#10+
'you may visit our site http://www.scalabium.com'#13#10+
'or contact by email [email protected]'#13#10+
#13#10+
'With best regards, Mike Shkolnik');
eml.Properties.AddTypedValue(PR_BODY_HTML,
''#13#10+
''#13#10+
''#13#10+
''#13#10+
'Hello,
'#13#10+
'you may visit our site http://www.scalabium.com
'#13#10+
'or contact by email [email protected]
'#13#10+
'With best regards, Mike Shkolnik
'#13#10+
'');
eml.Properties.AddAttachmentFile(ExtractFilePath(Application.ExeName) + 'scalfaq.gif');
eml.SaveToEMLFile(ExtractFilePath(Application.ExeName) + 'test.eml', True)
finally
eml.Free
end;
ShowMessage('File ' + ExtractFilePath(Application.ExeName) + 'test.eml' + ' created succesfully');
end;