Emailing through outlook! lazarus / 61-Beginners ---------------------------------------------------------------------- vks · 2015-03-05 05:57 Hello.. I m here with another problem! I have a code here to send mail from delphi through outlook.It is working fine. Code: [Select]uses   ComObj; procedure TForm1.Button16Click(Sender: TObject); const   olMailItem = 0;   olByValue = 1; var   OutlookApp, MailItem : OLEVariant; begin   try     OutlookApp := GetActiveOleObject('Outlook.Application');   except     OutlookApp := CreateOleObject('Outlook.Application');   end;   try     MailItem := OutlookApp.CreateItem(olMailItem);     MailItem.Recipients.Add('YourMailAddress@something.com');     MailItem.Subject := 'Your Subject';     MailItem.Body    := 'Your Message';     MailItem.Send;   finally     myAttachments := VarNull;     OutlookApp    := VarNull;   end; end; But when i try to assign MailItem.Body to a string variable,like: Code: [Select]var s: String; procedure TForm1.Button16Click(Sender: TObject); ... s:='Hello'; ... MailItem.Body:=s; This code converts the string to other language when I see it in inbox. I am unable to know what the problem is.Kindly do help me with it. ---------------------------------------------------------------------- ChrisF · 2015-03-05 12:10 MailItem.Body:= UTF8Decode(s);  ? ---------------------------------------------------------------------- vks · 2015-03-05 12:39 Hello ChrisF.. I got 'SIGSEGV exception' :-( ---------------------------------------------------------------------- ChrisF · 2015-03-05 13:51 Sorry, I can't make any test with Outlook. Make a try with a variable instead (eventually a global variable). Something like: Code: [Select]... var wsBody: widestring; ...   wsBody:=UTF8Decode(s);   MailItem.Body:=wsBody; ... ---------------------------------------------------------------------- vks · 2015-03-06 10:10 Woah.. It worked!! thank you so much )