Posts Tagged ‘smmsg’

SMMsg suite and time zone for dates

Wednesday, March 11th, 2015

Today I fixed the issue in SMMsg suite for dates in .msg-files. Now the dates processed and converted to local time zone correctly (function FileTimeToElapsedTime)

The correct code is

  function FileTimeToElapsedTime(FileTime: TFileTime): TDateTime;
  var
    SystemTime, LocalSystemTime: TSystemTime;
    TZ: TTimeZoneInformation;
  begin
    Result := 0;
    try
      if FileTimeToSystemTime(FileTime, SystemTime) then
      begin
        if (GetTimeZoneInformation(TZ) <> 0) then
          if SystemTimeToTzSpecificLocalTime(@TZ, SystemTime, LocalSystemTime) then
            Result := SystemTimeToDateTime(LocalSystemTime);
      end;
    except
    end
  end;

SMMsg suite: how to create the .eml file from code

Friday, February 1st, 2013

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,
               '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'#13#10+
               '<HTML><HEAD>'#13#10+
               '</HEAD>'#13#10+
               '<BODY>'#13#10+
               '<p>Hello,</p>'#13#10+
               '<p>you may visit our site <a href="http://www.scalabium.com">http://www.scalabium.com</a><br>'#13#10+
               'or contact by email <a href="mailto:[email protected]">[email protected]</a></p>'#13#10+
               '<p>With best regards, Mike Shkolnik</p>'#13#10+
               '</BODY></HTML>');
 
    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;

MAPI Message Flags

Tuesday, March 22nd, 2011

Today I added in SMMsg suite and Viewer for MS Outlook Messages the functions to work with flags in message (PR_MESSAGE_FLAGS attribute)

The list of flags published at http://msdn.microsoft.com/en-us/library/cc839733(v=office.12).aspx

const
//The message is marked as having been read
MSGFLAG_READ            = $00000001;
//The outgoing message has not been modified since the first time that it was saved; the incoming message has not been modified since it was delivered
MSGFLAG_UNMODIFIED      = $00000002;
//The message is marked for sending
MSGFLAG_SUBMIT          = $00000004;
//The message is still being composed. It is saved, but has not been sent
MSGFLAG_UNSENT          = $00000008;
//The message has at least one attachment
MSGFLAG_HASATTACH       = $00000010;
//The messaging user sending was the messaging user receiving the message
MSGFLAG_FROMME          = $00000020;
//The message is an associated message of a folder
MSGFLAG_ASSOCIATED      = $00000040;
//The message includes a request for a resend operation with a nondelivery report
MSGFLAG_RESEND          = $00000080;
//A read report needs to be sent for the message.
MSGFLAG_RN_PENDING      = $00000100;
//A nonread report needs to be sent for the message
MSGFLAG_NRN_PENDING     = $00000200;
//The incoming message arrived over an X.400 link
MSGFLAG_ORIGIN_X400     = $00000400;
//The incoming message arrived over the Internet
MSGFLAG_ORIGIN_INTERNET = $00000800;
//The incoming message arrived over an external link other than X.400 or the Internet
MSGFLAG_ORIGIN_MISC_EXT = $00001000;

Now it looks so:


Message Flags