beating my head against the wall with SMTP mail

Giganews Newsgroups
Subject: beating my head against the wall with SMTP mail
Posted by:  Larry (lkill…@charter.net)
Date: Wed, 28 Feb 2007

Last year I created a small program that runs twice a day and sends out
three reports as PDFs to a selection of executives at a poultry plant.
Works without a hitch.

We won a contract at one of their other plants and they requested the same
automatic reporting.  I pulled up the old app, adjusted a few lines of code,
installed it in the scheduler and expected it to work.  It does not.

This other plant uses the same corporate SMTP mail server.  The only
difference is that it is running on another computer at another geographical
location.  On that computer, I brought up Outlook Express and tested the
account and was able to send myself E-mail to the designated SMTP account
that they provided us.

I then stripped down the program to its barest essentials and installed on
the clients computer.  Still no go.  I run this version on my own computer
(using a test SMTP account provided by my network admin) and it runs without
a hitch.  It is an empty report with a label stating "I AM HERE".  Nothing
else.

I had their coporate webmaster try to see if he could detect may mail
hitting the SMTP server.  He was not very sure on how to do this.  They use
"Mitel Networks SME Server V5".

The computer does not have any antivirus software directly installed nor is
it behind a firewall.

Can someone haelp me trouble-shoot this nightmare?  I would appreciate any
advise, test app, ideas to figure this one out.

Thanks in advance

Larry

unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ppEmail,
  ppCtrls, ppBands, ppVar, ppPrnabl, ppClass, ppCache,
  ppComm, ppRelatv, ppProd, ppReport, ComCtrls, Buttons, ppSMTPIndy10,
  DateUtils,  Spin,  ppModule, raCodMod, ppParameter;

type
  TfrmMain = class(TForm)
    ppFreqRep: TppReport;
    ppTitleBand1: TppTitleBand;
    ppHeaderBand1: TppHeaderBand;
    ppDetailBand1: TppDetailBand;
    ppFooterBand1: TppFooterBand;
    ppShape1: TppShape;
    ppLabel7: TppLabel;
    lblStatus: TLabel;
    ppParameterList2: TppParameterList;
    Button1: TButton;
    Memo1: TMemo;
    ppLabel9: TppLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    procedure ProcessReport;
    procedure RunFreqReport;
    procedure RunExecutiveMailer;

    { Private declarations }
  public
    { Public declarations }
    ReportCol : TppEmail;
  end;

var
  frmMain: TfrmMain;
implementation

{$R *.dfm}

procedure TfrmMain.Button1Click(Sender: TObject);
begin
  ProcessReport;
end;

procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
    ReportCol.Free;
end;

procedure TfrmMain.FormShow(Sender: TObject);
begin
  lblStatus.Caption := 'Running';
end;

procedure TfrmMain.ProcessReport;
begin
    ReportCol := TppEmail.Create;
    lblStatus.caption := 'Report Col created';
    RunExecutiveMailer;
end;

procedure TfrmMain.RunFreqReport;
begin
    lblStatus.Caption := 'Processing Histogram';
    self.Refresh;
  try

    With ppFreqRep.EmailSettings do
    Begin
      FileName := 'HistogramTest.PDF';

      HostAddress := 'mail.marshalldurbin.com';
      UserName := 'gainco';
      Password := 'passss';
      FromAddress := 'gain…@marshalldurbin.com';
      Recipients.Add('gcr…@marshalldurbin.com');
      Recipients.Add('gain…@marshalldurbin.com');

      Body.Add('Please E-mail Larry Killen if you get this E-mail ');
      Body.Add('THIS IS A TEST');
      Body.Add('For additional information, comments or requests call');
      Body.Add('Larry Killen, MS');
      Body.Add('Senior Software Designer');

      Subject := 'Testing '+DateTimeToStr(Now);
    end;

    try
      ReportCol.AddReport(ppFreqRep);
      Memo1.Lines.Add('ReportCol.AddReport(ppFreqRep)');
      Memo1.Lines.Add(DateTimeToStr(NOW));
    except
      on E:Exception do
      Begin
        Memo1.Lines.Add(e.Message);
      End;
    end;
  finally
  end;
end;

procedure TfrmMain.RunExecutiveMailer;
begin
    RunFreqReport;
    ReportCol.Send;

    ShowMessage('report sent: ' + DateTimeToStr(NOW));
    application.Terminate;
end;

END.

Replies