YAFLogo

SteveInTN
  • SteveInTN
  • 69.8% (Friendly)
  • YAF Lover Topic Starter
8 years ago
I upgraded to v 2.2 a week ago and now I am having problems sending emails through my GMail account. This was working fine prior to the upgrade, now it is complaining about authentication:

SendMailThread failed with an SmtpException (Email to:me@myemailcom, Subject: Test): System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at YAF.Core.Services.YafSendMail.SendAll(IEnumerable`1 messages, Action`2 handleException)

I have verified my settings in the app.config, mail.config. All is good as far as I can tell. Any advice?
Sponsor

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
8 years ago
Originally Posted by: SteveInTN 

I upgraded to v 2.2 a week ago and now I am having problems sending emails through my GMail account. This was working fine prior to the upgrade, now it is complaining about authentication:

SendMailThread failed with an SmtpException (Email to:me@myemailcom, Subject: Test): System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at YAF.Core.Services.YafSendMail.SendAll(IEnumerable`1 messages, Action`2 handleException)

I have verified my settings in the app.config, mail.config. All is good as far as I can tell. Any advice?



I think for gmail you need to turn on SSL is the setting YAF.UseSMTPSSL set to true in the app.config?

<add key="YAF.UseSMTPSSL" value="true" />

Don't forget to restart the application after you change something in the app.config
SteveInTN
  • SteveInTN
  • 69.8% (Friendly)
  • YAF Lover Topic Starter
8 years ago
Yes, I am pretty sure that all of my configuration is correct. It was working BEFORE I upgrade to 2.2 about a week ago. I did the upgrade, so none of the .config files were overwritten.

How could the upgrade process to 2.2 have resulted in this if the .config files did not change?

I have this in the app.config:



My mail config:








SteveInTN
  • SteveInTN
  • 69.8% (Friendly)
  • YAF Lover Topic Starter
8 years ago
Okay, I think I found it. Like I said, my mail.config was not changed during the upgrade to 2.2. For whatever reason I didn't set the FROM email value properly before, but it worked. All I did was set the FROM address highlighted below to match my userName. It seems all is well now.








volkans80
8 years ago
Hi,

I just installed 2.2.0 and I get the same error but i can't solve even changing from field.

Error says that: Authentication Required but we are already give authentication info. I think yaf forgetting to send authentication info.

SSL configuration is enabled and restarted app.



SMTP configuration:







volkans80
8 years ago
Ok I solved.

The problem was wrong password. But why error says authentication required? Interesting.
xjohny
  • xjohny
  • 65.6% (Friendly)
  • YAF Camper
8 years ago
I'm too having issues with email. Everything worked well before 2.2.0, no changes in mail.config. But now it suddenly reject emails with message:
System.Net.Mail.SmtpException: Syntax error in parameters or arguments. The server response was: 5.7.1 <username@myforum.cz>... Permission denied

Strange is that it uses my user's email address instead of what is set in the mail.config.
board@myforum.cz" deliveryMethod="Network">

board@myforum.cz" />


Was there some change related to this?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
8 years ago
What email address is defined in the board settings?
xjohny
  • xjohny
  • 65.6% (Friendly)
  • YAF Camper
8 years ago
Forum email is: board@myforum.cz

Well the mailing system actually works partially - users get notification of new private messages, admin can send bulk emails using Administration > Mail option.

But the issue is, that if anyone selects option to Email another user (using the Email button under user's message. Then the system will automatically use his email address. That cannot definately work because the SMTP server won't authorize such request.

Example situation (for better understanding):
- I am a user with user1@email.com address
- I want to write an email to different user => I click on the Email button under another user's message.
- The forum will compose the mail message but for SMTP authentication it will use the user1@email.com address instead of the one defined in mail.config (board@myforum.cz).
- The authentication will fail.

I don't know what's the inner mechanism, maybe it's just a limitation on the SMTP server which disallows using different value in the From field than the login credentials. My SMTP requires the valid (registered) full email address as a login name.


xjohny
  • xjohny
  • 65.6% (Friendly)
  • YAF Camper
8 years ago
If I try to tweak the SMTP settings it either says something like:
[list]
  • defaultCredentials="false" - "Permission denied for (user1@myforum.cz)"
  • [*]defaultCredentials="true" - "We do not relay" [/list]
    tha_watcha
    • tha_watcha
    • 100% (Exalted)
    • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
    8 years ago
    Originally Posted by: xjohny 

    Forum email is: board@myforum.cz

    Well the mailing system actually works partially - users get notification of new private messages, admin can send bulk emails using Administration > Mail option.

    But the issue is, that if anyone selects option to Email another user (using the Email button under user's message. Then the system will automatically use his email address. That cannot definately work because the SMTP server won't authorize such request.

    Example situation (for better understanding):
    - I am a user with user1@email.com address
    - I want to write an email to different user => I click on the Email button under another user's message.
    - The forum will compose the mail message but for SMTP authentication it will use the user1@email.com address instead of the one defined in mail.config (board@myforum.cz).
    - The authentication will fail.

    I don't know what's the inner mechanism, maybe it's just a limitation on the SMTP server which disallows using different value in the From field than the login credentials. My SMTP requires the valid (registered) full email address as a login name.




    I understand the problem, but first of all that that code has not been changed. The problem is if user a wants to send an email to user b, yaf needs to send the email with the from email address of user a otherwise user b wouldn't be able to reply.

    YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button