|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am writing an Encryption Application for Emails that will be sent through MS Outlook Express. Everything is working except for one thing that I cannot solve. In the body of the Email when Outlook Express has been launched by my program there is a blank line above the emails text in the Body of the email. The blank line only happens in Outlook Express, not in my program. Here is my code used to open Outlook Express and insert the Subject: - To: and Body fields. Code:
procedure TForm1.FlatButton6Click(Sender: TObject);
begin
with TMAPIMail.Create(Self) do
try
Subject := FlatEdit1.Text;
Body := FlatMemo1.Lines.Text;
Recipients.Add(FlatEdit2.Text);
Recipients.Add('CC:test@yahoo.com');
Recipients.Add('BCC:test@mail.com');
Attachments.Add('c:\autoexec.bat');
EditDialog := True;
Send
finally
Free
end;
end;
I am using a component called TMAPIMail but I have also tried without using any components, but the blank line is still inserted. My question is, how can this line be removed? Does anyone here know why this is happening? I have posted this question on numerous forums but nobody seems to know. If you need more information or I haven't explained it clear enough just ask me! I have been stuck on this problem for some time, and I'm desperate for a solution! Many thanks, Nester |
|
#2
|
||||
|
||||
|
Well ... my logic says the line it's either from Outlook, either from your app ... so ... to test it do this:
Code:
... Body := ''; ... If a line appears then it's from Outlook, if not then the text that you send to Outlook contains a line. P.S. "TMapimail component provides possibility send mail via messaging application interface. Use mapi32.dll for sending messages via e-mail. This is trial version of tmapimail component. version include work with address book, read mail messages stored in inbox folder, save and send messages by e-mail. Contact with author by e-mail tmapiemail@yahoo.com."
__________________
If i've been helpful, please add to my reputation. My unfinished site: http://www.dever.ro Last edited by SilverDB : October 17th, 2005 at 06:11 AM. |
|
#3
|
|||
|
|||
|
Hi,
Thank you very much for replying. I have found a temporary solution, it's not very elegant but it works! On Memo Change, I have put: Code:
begin if FlatMemo1.Lines.Strings[0] = '' then begin FlatMemo1.Lines.Delete(0); end; The only problem now is you can't press enter on the first line but I think that could be fixed by trapping the enter key. The blank line was preventing the Decryption from working and giving 'Invalid Base64 Character' error. Also Outlook Express doesn't seem to be handling line breaks very well, I stayed up all night messing with settings and the only thing that works is to have it sent in plain text as quoted printable, auto wrapped at 76 in MIME format. Using any other setting and I get the Base64 error. When the text is encrypted in Outlook Express it will just not wrap at all, it's just one long string. This combined with the blank line problem was driving me mad! I'm just glad I've found some sort of solution! Many thanks for your help Nester |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > Outlook Express - Inserting Blank Line - Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|