Solved

D4 Pro NMSMTP Question

Posted on 2002-07-11
2
274 Views
Last Modified: 2010-04-04
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.FromAddress := Edit1.Text;
  NMSMTP1.PostMessage.ToAddress.Add(Edit2.Text);
  NMSMTP1.PostMessage.Body.Add(Edit4.Text);
  NMSMTP1.PostMessage.Subject := Edit3.Text;
  //NMSMTP1.PostMessage.LocalProgram := '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!
0
Comment
Question by:GStarling
2 Comments
 
LVL 7

Accepted Solution

by:
Cynna earned 150 total points
ID: 7147570
GStarling,

1. If your SMTP server requires password you are out of luck - NMSMTP doesn't support password authentification. SMTP protocol doesn't require password, but some servers use authentication extension to supress spamming.

2. Using NetMasters (NM...) components is living on the edge. They are notorious for their bugs. If you're serious about your app *at all* you'll forget them ASAP. Usual advice after this is:

use INDY or ICS (both freeware, reliable, plenty of examples *and* offering password authentication).

INDY: http://www.nevrona.com/Indy/download80.html
 ICS: http://overbyte.delphicenter.com/frame_index.html

0
 
LVL 1

Author Comment

by:GStarling
ID: 7167325
Thanks for the info.  I got it to work with my ISP and am not sure what I did.  I think I had a space or non-printable character in one of the component properties.  Either way, it now works.  Then went out of town for a conference and just got back.

I think I will rewrite the app to use one of your recommended components.  Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

867 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

22 Experts available now in Live!

Get 1:1 Help Now