GStarling
asked on
D4 Pro NMSMTP Question
I am writing an application where business clients will connect to their preferred ISP using anything from Cable, DSL, T1, dial-up to AOL, or calling their local Mom-and-Pop ISP for internet access, and send a series of emails generated from database reports. (No, this isn't a spam-generator!)
The NMSMTP control in Delphi 4 Pro looked like the solution, except it connects and immediately disconnects from my ISP. A code sample from a simplified test project follows:
procedure TForm1.Button1Click(Sender : TObject);
begin
NMSMTP1.Host := Edit5.Text;
NMSMTP1.Port := StrToInt(Edit6.Text);
Memo1.Lines := NMSMTP1.WSAInfo; //Show me what's happening during testing
NMSMTP1.UserID := Edit6.Text;
NMSMTP1.Connect;
NMSMTP1.PostMessage.FromAd dress := Edit1.Text;
NMSMTP1.PostMessage.ToAddr ess.Add(Ed it2.Text);
NMSMTP1.PostMessage.Body.A dd(Edit4.T ext);
NMSMTP1.PostMessage.Subjec t := Edit3.Text;
//NMSMTP1.PostMessage.Loca lProgram := 'NMSMTP Demo';
NMSMTP1.SendMail;
NMSMTP1.Disconnect;
end;
The mail server for the ISP I use for testing is on a Linux box running sendmail as the Message Transfer Agent (MTA). I suspect a password is required that matches the user name. I can't find a password property for this control. If that is the problem, how do I send one? Leaving the UserID property blank did not work, either.
Any comments on getting this to work with AOL after I get it to work with everyone else would also be helpful. Thanks!
The NMSMTP control in Delphi 4 Pro looked like the solution, except it connects and immediately disconnects from my ISP. A code sample from a simplified test project follows:
procedure TForm1.Button1Click(Sender
begin
NMSMTP1.Host := Edit5.Text;
NMSMTP1.Port := StrToInt(Edit6.Text);
Memo1.Lines := NMSMTP1.WSAInfo; //Show me what's happening during testing
NMSMTP1.UserID := Edit6.Text;
NMSMTP1.Connect;
NMSMTP1.PostMessage.FromAd
NMSMTP1.PostMessage.ToAddr
NMSMTP1.PostMessage.Body.A
NMSMTP1.PostMessage.Subjec
//NMSMTP1.PostMessage.Loca
NMSMTP1.SendMail;
NMSMTP1.Disconnect;
end;
The mail server for the ISP I use for testing is on a Linux box running sendmail as the Message Transfer Agent (MTA). I suspect a password is required that matches the user name. I can't find a password property for this control. If that is the problem, how do I send one? Leaving the UserID property blank did not work, either.
Any comments on getting this to work with AOL after I get it to work with everyone else would also be helpful. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think I will rewrite the app to use one of your recommended components. Thanks.