NetTalk Central

Author Topic: email and settings.ini  (Read 5356 times)

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
email and settings.ini
« on: March 22, 2015, 03:14:38 PM »
Bruce,

     I'm revisiting an old app based on the secwin nettalk example.  When I try to add a new user and have an email sent with a link to finalize the new user, nothing seems to happen...no errors, etc.  I do see a record added in the dssw5.tps file (operators.png), but no email is sent to the target email address I enter.  I have also attached an image of my settings.ini file (TestSettings.png).
     I believe I have the smtp settings correct, as I use these settings in a client app to receive email daily.  I have compiled an run this web app locally on port 443 with SSL.  I'm using NT 8.41.  Any thoughts?

Thanks,

Jeff

[attachment deleted by admin]
« Last Edit: March 22, 2015, 03:16:10 PM by kingja »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: email and settings.ini
« Reply #1 on: March 22, 2015, 09:56:36 PM »
Hi Jeff,

you want to "log" the "conversation" between the email client procedure and the email server.
ie you want to capture all the text going out though .SEND and coming in via .PROCESS.
In both cases net.packet.bindata contains the text.

I would add ErrorTrap into the log as well so you can see if there are any errors.

Then you should easily be able to see what is going on.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #2 on: March 23, 2015, 09:26:31 AM »
Bruce,

     I assumed you meant log with debugview, so I have attached my log settings and the actual log of one session, attempting to send an email.  I really don't know what to look for in the log but I did read through it.  Line 2427 seems to indicate a successful connection to my smtp server.  Starting at line 2966 seems to be the area where the email to be sent is constructed.  I'm hoping you can see something in the log.

Thanks,

Jeff
     
     

[attachment deleted by admin]
« Last Edit: March 23, 2015, 09:33:20 AM by kingja »

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #3 on: March 24, 2015, 11:36:08 AM »
Bruce,

I signed up for an smtp mail account at SMTP2Go.  Using their settings, I still can't get the emails to be sent.  I'm running from a Win 7 VM.  I have modified the Firewall on both the host and guest OS's, as well as my router.  All seems to be correct but I'm still stuck.

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #4 on: March 24, 2015, 05:41:40 PM »
Bruce,

     I have had some success.  I looked at the most recent example 51 and noticed the SendEmail and GetSettings procedures had different code (newer than mine) in the embeds.  In particular, the newer SendEmail procedure has embeds for "Error trap", "Send" and "Process", which show how self._trace is used to log all this in debugview.  This was not obvious from your previous response. 
     So, I compiled the web51 app to run locally on port 88 (no SSL) with my local ISP (Verizon) smtp settings.  It did not work.  Then I used the smtp settings from the test account I have at SMTP2Go and this did work.  It uses port 2525 whereas my local ISP uses port 465.  I'll experiment more with SSL to see how far I get.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: email and settings.ini
« Reply #5 on: March 24, 2015, 11:16:05 PM »
You can play with settings in the NetDemo program - Send Email window - to see which setting combinations work best for your server.
Different servers prefer different settings sometimes.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #6 on: March 25, 2015, 01:22:29 PM »
Bruce,

Thanks.  I have found various ways to make this work when the web app is compiled as an exe and run locally.  However, when I compile it as a dll and run from the host.exe, it always fails..."The attempt to send email failed".  I know the host.exe is not designed to run secwin apps but in the past I have been able to run just one with all others as no-secwin apps.  Something to note, the dssw5.tps and settings.ini file are always created in the host.exe folder, not in the app dll folder where expected.

This particular secwin app did work in the past, probably before NT 8.  Has anything changed in version 8 that would now prevent it from working with the Host.exe?

Thanks,

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #7 on: March 25, 2015, 07:55:23 PM »
Bruce,

I think I now have things configured properly to produce a log.  I have attached the most recent log, where I enter an email address to receive the link to create a new user.  This is for a exe version of my app, not a dll running in host.exe.  As I mentioned earlier, nothing seems to happen...no error messages etc.  

In line 1433 of the log, it seems to indicate the smtp connection was successful, and is waiting for a welcome message.  It seems this message does not arrive.  Further, I can find references to "error trap" but I don't see any references to net.packet.bindata.

I'm working on creating a log when run from the host.exe and will post this later.

Thanks,

Jeff

[attachment deleted by admin]
« Last Edit: March 25, 2015, 08:50:02 PM by kingja »

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #8 on: March 26, 2015, 05:58:17 PM »
Bruce,

     I have attached a log from the NT/SecWin app running as a dll on the host.exe.  The Host app is running 13 non-secwin apps and this one secwin app, called MINT.  This all is running on a virtual Win 2008 R2 server.  I'm attempting to use an Exchange server on the same network.  I have an account and can send emails with it.

     Line 1061 shows an smtp response of 250 (Sender OK).  Line 1063 sets the email address I'm trying to send to.  Line 1089 shows an smtp response of 550, unable to relay.  To generate this log, I first started host.exe.  Then I started debugview.  Next, I went to another machine and started my browser and connected to the NT app.

My settings.ini has the following (without data):

[Settings]
EmailServer=
EmailPort=
EmailAuthUser=
EmailAuthPassword=
FromAddress=
EmailSSL=1
EmailStartTLS=1

I have had limited success with an exe version of this app running locally, but even this seems to work one time and not another.  Can you offer any other tips?

Thanks,

Jeff

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: email and settings.ini
« Reply #9 on: March 26, 2015, 09:58:48 PM »
>>  Line 1089 shows an smtp response of 550, unable to relay.

This likely means that the AuthUser and AuthPassword are not being used correctly, or not being used at all.
See User Group Webinars;
http://www.capesoft.com/accessories/NetTalkUserGroup.htm
#44, circa 0:24
#35, right at the begining

cheers
Bruce



kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #10 on: March 27, 2015, 09:08:30 AM »
Bruce,

     I think you are right.  I ran a test through an external smtp server, SMTP2Go.  It has an option to send without using an SMTP username/password.  It works great.  As soon as I try my username/password, it fails.

I'll take a look at the two webinars you referenced.

Thanks,

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #11 on: March 27, 2015, 09:54:18 PM »
Bruce,

     I took a look at these two webinars and it did show I have the same issues discussed.  Basically, the User and Password do not get passed to the server correctly or at all.  I tried some of the modifications to code in the SendEmail procedure but it did not work for me.  Finally, I entered my user and password on the template, and commented out any code to deal with user and password.  I also removed EmailUser and EmailPassword from the settings.ini file.  Now it works.
     I used an old example 51 app to originally build this server.  It seems I have an old version of sendemail, etc.  Do you know of a more up-to-date example that contains a newer sendemail procedure I can import?  The basic problem I see is that there does not seem to be anywhere in code, parameters, etc. where the user and password are being passed.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: email and settings.ini
« Reply #12 on: March 30, 2015, 07:32:23 PM »
I've updated example 11 for the 8.43 build.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: email and settings.ini
« Reply #13 on: March 31, 2015, 08:21:53 AM »
Thanks Bruce!