Author Topic: Emailer threading  (Read 4247 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Emailer threading
« Reply #15 on: June 14, 2017, 08:06:32 PM »
Download and extract the attached solution. Open the Form1 and set the properties, then see what result you get from this.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #16 on: June 16, 2017, 02:55:35 PM »
Same error message.

An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll

Additional Information: The SMTP server requires a secure connection or the client is not authenticated. The server response was: Authentication required


thanks!!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Emailer threading
« Reply #17 on: June 16, 2017, 04:00:30 PM »
When it stops at the exception, hover over "Client" and see if UseDefauleCredentials is False and Credentials are set to something.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #18 on: June 16, 2017, 04:13:16 PM »
I start with visual studio so I do not understand everything but if you want one could use team viewer you could see for yourself.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Emailer threading
« Reply #19 on: June 16, 2017, 04:24:40 PM »
I'm not able to do a TeamViewer session today, but if you hover the mouse cursor over "client" on the line of code in which it stopped at, a window will popup with all of the properties and their values. Scroll through that list and look for UseDefauleCredentials and Credentials to see what value they have.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #20 on: June 16, 2017, 04:48:21 PM »

 Credentials = {System.Net.NetworkCredential}         

UseDefaultCredentials = False

Phrog30

  • Guest
Re: Emailer threading
« Reply #21 on: June 16, 2017, 05:01:10 PM »
What happens if you use the code in reply #3? Assuming you are using Gmail, just input your specific info.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #22 on: June 16, 2017, 05:12:54 PM »
I do not understand what you mean?

Phrog30

  • Guest
Re: Emailer threading
« Reply #23 on: June 16, 2017, 05:21:13 PM »
Go to reply #3 in this thread and copy the code, paste it in your application and try it, obviously using your email settings.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #24 on: June 16, 2017, 05:29:08 PM »
I did it and it works very well its the emailer function which wants not to work with the same email setting.

Phrog30

  • Guest
Re: Emailer threading
« Reply #25 on: June 16, 2017, 05:49:31 PM »
Ok, now I don't understand. That code is an emailer.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Emailer threading
« Reply #26 on: June 17, 2017, 06:41:53 PM »
I have tried this using the emailer component and the using the code you posted, in both cases I get the same message from Gmail:

"The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."

I even went into my Gmail settings and turned on the "Allow less secure apps" setting, but it still does not work.

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #27 on: June 18, 2017, 09:06:22 PM »
I managed to run the emailertest that you made me try at Reply # 15 by modifying the code as follows:

  Client.Credentials = NewSystem.Net.NetworkCredential( m_SmtpLoginUserName , m_SmtpLoginPassword)
 

I modify the line so high by:

  Client.Credentials = NewSystem.Net.NetworkCredential ("sebastienduhaime@gmail.com", "xxxxxxxx")

But when I made the same change in the anvanced HMI emailer its not working.


Thank you very much for your help it is very appreciated!!!

sebas

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Emailer threading
« Reply #28 on: June 19, 2017, 03:32:41 PM »
Did you test with anything other than gmail and did it work?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Emailer threading
« Reply #29 on: June 20, 2017, 07:50:30 PM »
I finally got to the bottom of this problem. It will be fixed in the next version.