Solved

send email when event occures ..

Posted on 2001-08-14
36
658 Views
Last Modified: 2010-04-06
using Delphi 5,how to send email automaticcally when a certain event happens(like a certain date or time comes)?

answer will be graded better if supported by an example of code or project ..

this case if I was connected permenantly with a proxy to the internet ..

also what could be the alternative solution if I was connected by a modem to the internet ?
0
Comment
Question by:alim_maze
  • 19
  • 11
  • 3
  • +2
36 Comments
 
LVL 3

Accepted Solution

by:
rondi earned 150 total points
ID: 6383613
1. Your app would need to be running all the time eg.
   - have it run at Win startup by placing its path
     in the registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\
   - place a shortcut to the app in the windows startup folder (check out HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)

2. You'll probably want it to run discreetly
   -On Form Create:
     ShowWindow(Application.Handle, SW_HIDE);
     SetWindowLong(Application.Handle, GWL_EXSTYLE,
     GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW );
     ShowWindow(Application.Handle, SW_SHOW);
   -In the project source...
     Application.Initialize;
     Application.Title := '';
     Application.CreateForm(TForm1, Form1);
     ...

3. To send mail you have basically 3 options:
   - Use MS Outlook
      -Requires that outlook is installed on the target PC
      -Fast & easy to develop: very little code
      -don't need to worry about mail server connection etc..
   - Use MAPI
      -Also easy, but a little more code
      -Works with any mail client (?)
   - Use a custom SMTP client component
      -More coding req'd
      -requires mail server connection details
      -I recomend Francois Piettes TSMTPClient
         (http://www.rtfm.be/fpiette)

you shouldn't really have problems with proxies and SMTP,
usually problems are encountered with F/HTTP.

rondi.
0
 

Author Comment

by:alim_maze
ID: 6387212
ok .. very well ..

- very nice about running contintneously and discreetly ..

actually my PC is connected to internet all the time through proxy and I don't shut down it ..

- about using MS Outlook : I don't know how to use it ??!!
and I need to know how to use it ,because I have already outlook installed in my office.
- also I need a custom tool to use independently of outlook
I didn't find "TSMTPClient" in the mentioned page.
0
 

Author Comment

by:alim_maze
ID: 6387287
I found TSMTPClient in ICS and am trying it now ...
0
 

Author Comment

by:alim_maze
ID: 6387356
I found TSMTPClient in ICS and am trying it now ...
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6387409
I use a freeware-component (with sourcecode) to send an email to me whenever my software generates a serious error.

I will lookup the URL for fownloading this component. I'll be back...

Your mail software (MS Outlook) has to be active in order to be able to send emails using the component.

The Mayor.
0
 

Author Comment

by:alim_maze
ID: 6387418
the components TSMTPClient in ICS which uses SMTP host and port : what is SMTP host and port in my case ? (I connect internet with proxy server )

if this is the case : thers are many components in FastNet tab those use host and port , but which host and which port ????!!!!

         I just want my delphi5 application to send mail to an internet address like (alim_maze@hotmail.com)and I either connect the internet by proxy in my lan or by modem ????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!I!!!!DONT!!!!!!!!!KNOW!!!!!!!!WHAT!!!!!HOST!!!!!!??AND!!!WHAT!!!!!!??????????????????????????????????????????PORT!!!!!!!I!!WANT!!!!TO!SEND!!!!MAIL!!!.......!!!!!!!!!!!ONLY??????????????????????????????????????????/!!!!!!!!!!!
0
 

Author Comment

by:alim_maze
ID: 6387434
Mr. wimmeyvaert
    I respect you since you anderstand what I mean ..
exactly .. this is the reason and use which I want this comp. for ,tracing and alerting me on something occures ...

    I am waiting ..
0
 

Author Comment

by:alim_maze
ID: 6388075
Mr. The Mayor, am listening ..
0
 
LVL 3

Expert Comment

by:rondi
ID: 6388606
alim_maze,

to find out the host and port, just open Outlook and
look at the connections under Tools -> Options or look under Tools -> Email Accounts.

Copy the "outgoing mail server" and use the same port
which will probably be SMTP (i.e 25).

The code is pretty simple - take a look at the sample
applications...

  with SMTPClient1 do
  begin
    Host := 'smtp.myisp.com';
    Port := 'smtp';
    HdrTo := 'alim_maze@myisp.com';
    HdrFrom := 'delphi_app@mypc.dbg';
    HdrSubject := 'Auto Log info';
    Message.Lines.Add('An error occurred at 1654 PM');
    Send;
  end;

rondi.
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6405124
Hi,

Finally back again... Sorry for the delay.
The component I use is TMapiControl.

Give me your email-address and I'll send you the component.

Best regards,

The Mayor
0
 

Author Comment

by:alim_maze
ID: 6412190
The Mayor ..
it's very nice that you back !

please, mail me on Alim_maze@hotmail.com

thank's ..
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6412367
Hi Alim,

I just sent you the component.
Please let me know if you have received it.
In case of problems, I'm glad to help you out.

The Mayor.
0
 

Author Comment

by:alim_maze
ID: 6427839
The Mayor ...

am sorry , I don't find your message in my inbox , or mabe I deleted it by mistake , so please, resend me again ...


sorry again ..
alim.
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6427850
Hi Alim,

The mail should be on its way again.
Let me know if you received it.

Best regards,
The Mayor.
0
 

Author Comment

by:alim_maze
ID: 6439616
Mr. Mayor ..

I haven't reived any message from you till now !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?????????????????????????????????????????????????????????????

my Email address is quite clear : (alim_maze@hotmail.com)
if you are sure you sent me on this address , just give me your Email address here as a comment in this page ....



               ..... it's incredable  ! .......

0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6439829
Hi Alim,

I don't have any clue why my email could not be delivered.

Anyway, try to email me at wim.meyvaert@eca.be
and I'll reply to you with the EMailComponent.

Best regards,
The Mayor
0
 

Author Comment

by:alim_maze
ID: 6448719
ok Mayor , I did .
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6449802
Hi Alim,

I have just replied to your mail.
I hope this time your receive it.
Let's hope for the best ,-)


Best regards,
The Mayor
0
 

Author Comment

by:alim_maze
ID: 6460738
No .. no , nevere !

oh ..  
0
 
LVL 3

Expert Comment

by:rondi
ID: 6461079
I think it's a sign... ;)
Try www.rtfm.be/fpiette
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6463078
Hi Alim,

I 'll try to find the site were I once downloaded it.
Be back ...

The Mayor.
0
 
LVL 6

Assisted Solution

by:wimmeyvaert
wimmeyvaert earned 150 total points
ID: 6463082
Hi Alim,

Since I can't find anything in the Component-Code itself,

I'll post of the code of the component below :

*******************************************************

unit Comp_MapiControl;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  { Introducing a new Type of Event to get the Errorcode }
  TMapiErrEvent = procedure(Sender: TObject; ErrCode: Integer) of object;

  TMapiControl = class(TComponent)
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  private
    { Private-Deklarationen }
    FSubject: string;
    FMailtext: string;
    FFromName: string;
    FFromAdress: string;
    FTOAdr: TStrings;
    FCCAdr: TStrings;
    FBCCAdr: TStrings;
    FAttachedFileName: TStrings;
    FDisplayFileName: TStrings;
    FShowDialog: Boolean;
    FUseAppHandle: Boolean;
    { Error Events: }
    FOnUserAbort: TNotifyEvent;
    FOnMapiError: TMapiErrEvent;
    FOnSuccess: TNotifyEvent;
    { +> Changes by Eugene Mayevski [mailto:Mayevski@eldos.org]}
    procedure SetToAddr(newValue : TStrings);
    procedure SetCCAddr(newValue : TStrings);
    procedure SetBCCAddr(newValue : TStrings);
    procedure SetAttachedFileName(newValue : TStrings);
    { +< Changes }
  protected
    { Protected-Deklarationen }
  public
    { Public-Deklarationen }
    ApplicationHandle: THandle;
    procedure Sendmail();
    procedure Reset();
  published
    { Published-Deklarationen }
    property Subject: string read FSubject write FSubject;
    property Body: string read FMailText write FMailText;
    property FromName: string read FFromName write FFromName;
    property FromAdress: string read FFromAdress write FFromAdress;
    property Recipients: TStrings read FTOAdr write SetTOAddr;
    property CopyTo: TStrings read FCCAdr write SetCCAddr;
    property BlindCopyTo: TStrings read FBCCAdr write SetBCCAddr;
    property AttachedFiles: TStrings read FAttachedFileName write SetAttachedFileName;
    property DisplayFileName: TStrings read FDisplayFileName;
    property ShowDialog: Boolean read FShowDialog write FShowDialog;
    property UseAppHandle: Boolean read FUseAppHandle write FUseAppHandle;

    { Events: }
    property OnUserAbort: TNotifyEvent read FOnUserAbort write FOnUserAbort;
    property OnMapiError: TMapiErrEvent read FOnMapiError write FOnMapiError;
    property OnSuccess: TNotifyEvent read FOnSuccess write FOnSuccess;
  end;

procedure Register;

implementation

uses Mapi;

{ Register the component: }
procedure Register;
begin
  RegisterComponents('Testing', [TMapiControl]);
end;

{ TMapiControl }

constructor TMapiControl.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FOnUserAbort := nil;
  FOnMapiError := nil;
  FOnSuccess := nil;
  FSubject := '';
  FMailtext := '';
  FFromName := '';
  FFromAdress := '';
  FTOAdr := TStringList.Create;
  FCCAdr := TStringList.Create;
  FBCCAdr := TStringList.Create;
  FAttachedFileName := TStringList.Create;
  FDisplayFileName := TStringList.Create;
  FShowDialog := False;
  ApplicationHandle := Application.Handle;
end;

{ +> Changes by Eugene Mayevski [mailto:Mayevski@eldos.org]}
procedure TMapiControl.SetToAddr(newValue : TStrings);
begin
  FToAdr.Assign(newValue);
end;

procedure TMapiControl.SetCCAddr(newValue : TStrings);
begin
  FCCAdr.Assign(newValue);
end;

procedure TMapiControl.SetBCCAddr(newValue : TStrings);
begin
  FBCCAdr.Assign(newValue);
end;

procedure TMapiControl.SetAttachedFileName(newValue : TStrings);
begin
  FAttachedFileName.Assign(newValue);
end;
{ +< Changes }

destructor TMapiControl.Destroy;
begin
  FTOAdr.Free;
  FCCAdr.Free;
  FBCCAdr.Free;
  FAttachedFileName.Free;
  FDisplayFileName.Free;
  inherited destroy;
end;

{ Reset the fields for re-use}
procedure TMapiControl.Reset;
begin
  FSubject := '';
  FMailtext := '';
  FFromName := '';
  FFromAdress := '';
  FTOAdr.Clear;
  FCCAdr.Clear;
  FBCCAdr.Clear;
  FAttachedFileName.Clear;
  FDisplayFileName.Clear;
end;

{ Send the Mail via the API, this procedure composes and sends
  the Email }
procedure TMapiControl.Sendmail;
var
  MapiMessage: TMapiMessage;
  MError: Cardinal;
  Sender: TMapiRecipDesc;
  PRecip, Recipients: PMapiRecipDesc;
  PFiles, Attachments: PMapiFileDesc;
  i: Integer;
  AppHandle: THandle;
begin
  { First we store the Application Handle, if not
    the Component might fail to send the Email or
    your calling Program gets locked up. }
  AppHandle := Application.Handle;

  { We need all recipients to alloc the memory }
  MapiMessage.nRecipCount := FTOAdr.Count + FCCAdr.Count + FBCCAdr.Count;
  GetMem(Recipients, MapiMessage.nRecipCount * sizeof(TMapiRecipDesc));

  try
    with MapiMessage do
    begin
      ulReserved := 0;
      { Setting the Subject: }
      lpszSubject := PChar(Self.FSubject);

      { ... the Body: }
      lpszNoteText := PChar(FMailText);

      lpszMessageType := nil;
      lpszDateReceived := nil;
      lpszConversationID := nil;
      flFlags := 0;

      { and the sender: (MAPI_ORIG) }
      Sender.ulReserved := 0;
      Sender.ulRecipClass := MAPI_ORIG;
      Sender.lpszName := PChar(FromName);
      Sender.lpszAddress := PChar(FromAdress);
      Sender.ulEIDSize := 0;
      Sender.lpEntryID := nil;
      lpOriginator := @Sender;

      PRecip := Recipients;

      { We have multiple recipients: (MAPI_TO)
        and setting up each: }
      if nRecipCount > 0 then
      begin
        for i := 1 to FTOAdr.Count do
        begin
          PRecip^.ulReserved := 0;
          PRecip^.ulRecipClass := MAPI_TO;
          { lpszName should carry the Name like in the
            contacts or the adress book, I will take the
            email adress to keep it short: }
          PRecip^.lpszName := PChar(FTOAdr.Strings[i - 1]);
          { If you use this component with Outlook97 or 2000
            and not some of Express versions you will have to set
            'SMTP:' in front of each (email-) adress. Otherwise
            Outlook/Mapi will try to handle the Email on itself.
            Sounds strange, just erease the 'SMTP:', compile, compose
            a mail and take a look at the resulting email adresses
            (right click).
          }
          PRecip^.lpszAddress := PChar('SMTP:' + FTOAdr.Strings[i - 1]);
          PRecip^.ulEIDSize := 0;
          PRecip^.lpEntryID := nil;
          Inc(PRecip);
        end;

        { Same with the carbon copy recipients: (CC, MAPI_CC) }
        for i := 1 to FCCAdr.Count do
        begin
          PRecip^.ulReserved := 0;
          PRecip^.ulRecipClass := MAPI_CC;
          PRecip^.lpszName := PChar(FCCAdr.Strings[i - 1]);
          PRecip^.lpszAddress := PChar('SMTP:' + FCCAdr.Strings[i - 1]);
          PRecip^.ulEIDSize := 0;
          PRecip^.lpEntryID := nil;
          Inc(PRecip);
        end;

        { ... and the blind copy recipients: (BCC, MAPI_BCC) }
        for i := 1 to FBCCAdr.Count do
        begin
          PRecip^.ulReserved := 0;
          PRecip^.ulRecipClass := MAPI_BCC;
          PRecip^.lpszName := PChar(FBCCAdr.Strings[i - 1]);
          PRecip^.lpszAddress := PChar('SMTP:' + FBCCAdr.Strings[i - 1]);
          PRecip^.ulEIDSize := 0;
          PRecip^.lpEntryID := nil;
          Inc(PRecip);
        end;
      end;
      lpRecips := Recipients;

      { Now we process the attachments: }

      if FAttachedFileName.Count > 0 then
      begin
        nFileCount := FAttachedFileName.Count;
        GetMem(Attachments, MapiMessage.nFileCount * sizeof(TMapiFileDesc));

        PFiles := Attachments;

        { Fist setting up the display names (without path): }
        FDisplayFileName.Clear;
        for i := 0 to FAttachedFileName.Count - 1 do
          FDisplayFileName.Add(ExtractFileName(FAttachedFileName[i]));

        if nFileCount > 0 then
        begin
          { Now we pass the attached file (their paths) to the
            structure: }
          for i := 1 to FAttachedFileName.Count do
          begin
            { Setting the complete Path }
            Attachments^.lpszPathName := PChar(FAttachedFileName.Strings[i - 1]);
            { ... and the displayname: }
            Attachments^.lpszFileName := PChar(FDisplayFileName.Strings[i - 1]);
            Attachments^.ulReserved := 0;
            Attachments^.flFlags := 0;
            { Position has to be -1, please see the WinApi Help
              for details. }
            Attachments^.nPosition := Cardinal(-1);
            Attachments^.lpFileType := nil;
            Inc(Attachments);
          end;
        end;
        lpFiles := PFiles;
      end
      else
      begin
        nFileCount := 0;
        lpFiles := nil;
      end;
    end;

    { Send the Mail, silent or verbose:
      Verbose means in Express a Mail is composed and shown as setup.
      In non-Express versions we show the Login-Dialog for a new
      session and after we have choosen the profile to use, the
      composed email is shown before sending

      Silent does currently not work for non-Express version. We have
      no Session, no Login Dialog so the system refuses to compose a
      new email. In Express Versions the email is sent in the
      background.
     }
    if FShowDialog then
      MError := MapiSendMail(0, AppHandle, MapiMessage, MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0)
    else
      MError := MapiSendMail(0, AppHandle, MapiMessage, 0, 0);

    { Now we have to process the error messages. There are some
      defined in the MAPI unit please take a look at the unit to get
      familiar with it.
      I decided to handle USER_ABORT and SUCCESS as special and leave
      the rest to fire the "new" error event defined at the top (as
      generic error)

      Not treated as special:
      MAPI_E_AMBIGUOUS_RECIPIENT,
        MAPI_E_ATTACHMENT_NOT_FOUND,
        MAPI_E_ATTACHMENT_OPEN_FAILURE,
        MAPI_E_BAD_RECIPTYPE,
        MAPI_E_FAILURE,
        MAPI_E_INSUFFICIENT_MEMORY,
        MAPI_E_LOGIN_FAILURE,
        MAPI_E_TEXT_TOO_LARGE,
        MAPI_E_TOO_MANY_FILES,
        MAPI_E_TOO_MANY_RECIPIENTS,
        MAPI_E_UNKNOWN_RECIPIENT:
    }

    case MError of
      MAPI_E_USER_ABORT:
        begin
          if Assigned(FOnUserAbort) then
            FOnUserAbort(Self);
        end;
      SUCCESS_SUCCESS:
        begin
          if Assigned(FOnSuccess) then
            FOnSuccess(Self);
        end
    else begin
        if Assigned(FOnMapiError) then
          FOnMapiError(Self, MError);
      end;

    end;
  finally
    { Finally we do the cleanups, the message should be on its way }
    FreeMem(Recipients, MapiMessage.nRecipCount * sizeof(TMapiRecipDesc));
  end;
end;

{
  Please treat this as free. If you improve the component
  I would be glad to get a copy.
}

end.

*******************************************************

Just save this code into a new textfile and name this file
Comp_MapiControl.Pas

Then add this Pas-File to an existing package of your choice (maybe you already hav a package with some components in it you want to test out. At least, I have.

Open this package, and recompile it. From then on, you should have a tab 'Testing' with the MapiControl-component on it.

If you want help on using the component in an application, I'll make you a small demo, and post it as well on EE.

Best regards,
The Mayor.
0
 

Author Comment

by:alim_maze
ID: 6478684
The Mayor.
am figuring out what you've sent ..
0
 

Author Comment

by:alim_maze
ID: 6478726
I had the component : MapiControl in a new tab : Testing
and I used it in the folowing code : (I called the component mc in my project)


(************) (******) (**********) (******************)


implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
mc.Subject:='testing new component !';
mc.Body:='Hi baby .. it works !';
mc.FromName:='me !';
mc.FromAdress:='my address !';
mc.Recipients.Text:='alim_maze@hotmail.com';

mc.Sendmail;
end;

procedure TForm1.MCSuccess(Sender: TObject);
begin
showmessage('sent successfully .');
end;

procedure TForm1.MCMapiError(Sender: TObject; ErrCode: Integer);
begin
showmessage('Error sending mail msg !');
end;

procedure TForm1.MCUserAbort(Sender: TObject);
begin
showmessage('User abort.');
end;

end.

(************) (******) (**********) (******************)

it does'nt work ! it gives a seding error from the event :
MCMapiError .

and according to above code it gives the message :
'Error sending mail msg !' when button1 is pressed .

I think you should send a demo !!

thank's for you
alim.
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6479161
Hi Alim,

Here is a demo-project (source-code).
Place a Button + Mail-Component on the form, and then paste
the entire code in the Form-unit (paste it over the existing code in the unit).



/***start***/

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Comp_MapiControl, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    MapiControl1: TMapiControl;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    tstrTo          : TStringList;
    tstrCc          : TstringList;
    tstrBCc         : TstringList;
    tstrAtt         : TstringList;
    strSubject      : String;
    strBody         : String;
    procedure SendEMail(tstrTo, tstrCc, tstrBcc,tstrAttachments: TStringList; strSubject, strBody: String);
    procedure FillMailSettings;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  FillMailSettings;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(tstrTo);
  FreeAndNil(tstrCc);
  FreeAndNil(tstrBCc);
  FreeAndNil(tstrAtt);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  SendEMail(tstrTo,tstrCc,tstrBCc,tstrAtt,strSubject,strBody);
end;

procedure TForm1.FillMailSettings;
begin
  { Create all the stringlists }
  tstrTo := TStringList.Create;
  tstrTo.Clear;
  tstrCc := TStringList.Create;
  tstrCc.Clear;
  tstrBCc := TStringList.Create;
  tstrBcc.Clear;
  tstrAtt := TStringList.Create;
  tstrAtt.Clear;
  { Fill the stringlists and strings }
  tstrTo.Add('wim.meyvaert@eca.be');
  tstrCc.Add('johan.vandevyvere@eca.be');
  strSubject := 'Testing the mail-component ..';
  strBody    := 'BODY OF THE TESTMAIL';
end;



procedure TForm1.SendEMail(tstrTo, tstrCc, tstrBcc,
  tstrAttachments: TStringList; strSubject, strBody: String);
begin
  With MapiControl1 do
  begin
    Try
      { Fill the values. }
      Recipients.Assign(tstrTo);
      CopyTo.Assign(tstrCc);
      BlindCopyTo.Assign(tstrBcc);
      Subject := strSubject;
      Body := strBody;
      AttachedFiles.Assign(tstrAttachments);
      { Send the EMail. }
      Sendmail;
    except
      raise;
    end;
  end;
end;


end.

/***stop***/



Best regards,
The Mayor
The Mayor
0
 

Author Comment

by:alim_maze
ID: 6479287
Hello Mayor ..
it gives error  , generaterd from OnMAPIEroor event of your component !

....
0
 

Author Comment

by:alim_maze
ID: 6479292
even your demo does'nt work !
I expect that you had used it and succeed before ?! had'nt you ?
0
 

Author Comment

by:alim_maze
ID: 6532456
listen ,your component works , but it runs MicroSoft Outlook.

         my application  needs to send mail automaticcally,I don't want to be sit down and confirming messages and pressing buttons of the outlook forms , I want to make it send automatically when acertain event occurs ,,

you are very closed from my target ..
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6535264
I know the component makes use of the default Email-software, AND it has to be active (started) too.

I'm afraid I' can't help you out if you really have to send EMails without any email-software at all.

Maybe you can find components who do that on
Torry : www.torry.ru
or
Delphi Super Pages : http://delphi.icm.edu.pl/

Or

on the following sites, there is some code to do email :
http://www.delphi3000.com/articles/article_1243.asp
or
http://www.swissdelphicenter.ch/en/showcode.php?id=117
or
http://www.visualbuilder.com/sourcecode/viewcode.asp?id=169

Hope to be of some help anyway.

The Mayor.
0
 

Author Comment

by:alim_maze
ID: 6536102
checking that ..
0
 

Author Comment

by:alim_maze
ID: 6543851
The Mayor ,I belive you did your best till now ..

all codes that advice to use NMSMTP|Fast net needs some information to run the aplication properly :-

---------------------------------
  NMSMTP1.Host := 'mail.host.com';
// is it the physical host name of our Mail Exchange server that found in Network Properities (I mean the Computer host name) ????
or what is it ?? NMSMTP1.Host =????  
-----------------------------------

NMSMTP1.UserID := 'username';
// is it the user address Like : (SMTP:Mohdaa@Sudatel.net)
// or it is the network user  ID of the domain??
//or what (NMSMTP1.UserID := ??)

-----------------------------------------------------
  NMSMTP1.Connect;
//yes ,after this procedure the exception "Host Lookup Failed appears"
------------------------------------------------------
  NMSMTP1.PostMessage.FromAddress := 'webmaster@swissdelphicenter.ch';
  NMSMTP1.PostMessage.ToAddress.Text := 'user@host.com';
  NMSMTP1.PostMessage.Body.Text := 'This is the message';
  NMSMTP1.PostMessage.Subject := 'Mail subject';
  NMSMTP1.SendMail;
  showmessage('Mail sent !');
// I think this is a later stage !
---------------------------------
0
 

Author Comment

by:alim_maze
ID: 6543929
The Mayor ,I belive you did your best till now ..

all codes that advice to use NMSMTP|Fast net needs some information to run the aplication properly :-

---------------------------------
  NMSMTP1.Host := 'mail.host.com';
// is it the physical host name of our Mail Exchange server that found in Network Properities (I mean the Computer host name) ????
or what is it ?? NMSMTP1.Host =????  
-----------------------------------

NMSMTP1.UserID := 'username';
// is it the user address Like : (SMTP:Mohdaa@Sudatel.net)
// or it is the network user  ID of the domain??
//or what (NMSMTP1.UserID := ??)

-----------------------------------------------------
  NMSMTP1.Connect;
//yes ,after this procedure the exception "Host Lookup Failed appears"
------------------------------------------------------
  NMSMTP1.PostMessage.FromAddress := 'webmaster@swissdelphicenter.ch';
  NMSMTP1.PostMessage.ToAddress.Text := 'user@host.com';
  NMSMTP1.PostMessage.Body.Text := 'This is the message';
  NMSMTP1.PostMessage.Subject := 'Mail subject';
  NMSMTP1.SendMail;
  showmessage('Mail sent !');
// I think this is a later stage !
---------------------------------
0
 
LVL 6

Expert Comment

by:wimmeyvaert
ID: 6560074
What exactly do you want to know ?
I don't know much about the NMSMTP-Component, so maybe
another expert can help you out here.

The Mayor
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 6931821
Hopefully you've already been helped with this question, but thought you'd appreciate knowing this.  It would be great if you could bring this question to a conclusion, awarding the experts above who helped you with points or a comment to them on your status today.

WindowsUpdate has new updates for .NET users; Details follow - Microsoft .NET Framework
The .NET Framework is a new feature of Windows. Applications built using the .NET Framework are more reliable and secure. You need to install the .NET Framework only if you have software that requires it.

For more information about the .NET Framework, see http://www.microsoft.com/net. (This site is in English.)

System Requirements
The .NET Framework can be installed on the following operating systems:
Windows 98
Windows 98 Second Edition (SE)
Windows Millennium Edition (Windows Me)
Windows NT 4.0® (Workstation or Server) with Service Pack 6.0a
Windows 2000 with the latest service pack installed (Professional, Server, Datacenter Server, or Advanced Server)
Windows XP (Home Edition and Professional)
You must be running Internet Explorer version 5.01 or later for all installations of the .NET Framework.

To install the .NET Framework, your computer must meet or exceed the following software and hardware requirements:

Software requirements for server operating systems:
MDAC 2.6
Hardware requirements:
For computers running only a .NET Framework application, Pentium 90 mHz CPU with 32 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 mHz CPU with 128 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
Recomended software:
MDAC 2.7 is recommended.
Recommended hardware: For computers running only a .NET Framework application, Pentium 90 MHz CPU with 96 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 MHz CPU with 256 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.

How to use -> Restart your computer to complete the installation. No other action is required to run .NET Framework applications. If you are developing applications using the .NET Framework, you can use the command-line compilers or you can use a development environment, such as Visual Studio .NET, that supports using the .NET Framework.

How to uninstall
To uninstall the .NET Framework: Click Start, point to Settings, and then click Control Panel (In Windows XP, click Start and then click Control Panel.).
Click Add/Remove Programs.
Click Microsoft .NET Framework (English) v1.0.3705 and then click Change/Remove.
More here  http://www.microsoft.com/net/

The .NET topic is being considered for addition to our All Topics link soon, so this may interest you as well:
http://www.experts-exchange.com/newtopics/Q.20276589.html

EXPERTS POINTS are waiting to be claimed here:  http://www.experts-exchange.com/commspt/Q.20277028.html

":0)
Asta


0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8741809
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split points between rondi and wimmeyvaert

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now