Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Tregistry and idsmpt port number.

Posted on 2008-11-08
2
Medium Priority
?
179 Views
Last Modified: 2012-05-05
Reading info from the registry and i get and error.
[DCC Error] Unit1.pas(224): E2010 Incompatible types: 'Word' and 'string'
[DCC Fatal Error] QuickEmail.dpr(5): F2063 Could not compile used unit 'Unit1.pas'
procedure TForm1.sendmail;
var
  I : Integer;
  EMails : String;
  Subject : String;
  Body : String;
begin
  For I := 0 To ListView1.Items.Count - 1 Do
    begin
    R :=TRegistry.Create;
    R.Rootkey:=HKEY_CURRENT_USER;
      with R do try
        if keyexists('\Software\QuickEmail') = false then
          showmessage('No SMTP INFO PLEASE RUN SETUP')
            else
      begin
        CreateKey('\Software\QuickEmail');
        OpenKey('\Software\QuickEmail', True);
        idsmtp1.Host     := ReadString('Host');
        idsmtp1.Username := ReadString('User');
        idsmtp1.Password := ReadString('Pass');
        idsmtp1.Port     := ReadString('Port');
        R.CloseKey;
      end
        finally
      R.Free;
end;

Open in new window

0
Comment
Question by:Grant Fullen
2 Comments
 
LVL 13

Accepted Solution

by:
ThievingSix earned 500 total points
ID: 22914595
Just a guess
procedure TForm1.sendmail;
var
  I : Integer;
  EMails : String;
  Subject : String;
  Body : String;
begin
  For I := 0 To ListView1.Items.Count - 1 Do
    begin
    R :=TRegistry.Create;
    R.Rootkey:=HKEY_CURRENT_USER;
      with R do try
        if keyexists('\Software\QuickEmail') = false then
          showmessage('No SMTP INFO PLEASE RUN SETUP')
            else
      begin
        CreateKey('\Software\QuickEmail');
        OpenKey('\Software\QuickEmail', True);
        idsmtp1.Host     := ReadString('Host');
        idsmtp1.Username := ReadString('User');
        idsmtp1.Password := ReadString('Pass');
        idsmtp1.Port     := StrToIntDef(ReadString('Port'),25);
        R.CloseKey;
      end
        finally
      R.Free;
end;

Open in new window

0
 

Author Closing Comment

by:Grant Fullen
ID: 31514756
Thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question