Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 16th, 2005, 02:35 PM
nester nester is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 7 nester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 58 sec
Reputation Power: 0
Question Outlook Express - Inserting Blank Line - Problem

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

Reply With Quote
  #2  
Old October 17th, 2005, 06:04 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
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.

Reply With Quote
  #3  
Old October 17th, 2005, 09:11 AM
nester nester is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 7 nester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 2 m 58 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Outlook Express - Inserting Blank Line - Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT