Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set clientDomain in SmtpClient #2031

Closed
olmobrutall opened this issue Oct 30, 2018 · 2 comments
Closed

Set clientDomain in SmtpClient #2031

olmobrutall opened this issue Oct 30, 2018 · 2 comments

Comments

@olmobrutall
Copy link

The old implementation of SmtpClient (https://referencesource.microsoft.com/#system/net/System/Net/mail/SmtpClient.cs) was able to use the clientDomain from configuration MailConfiguration.Smtp.Network.ClientDomain;

  <smtp>
     <network host="somehost" port="25" clientDomain="mymachine.mydomain.com" enableSsl="false" />
  </smtp>

solving problems like this one: https://stackoverflow.com/questions/37410598/fqdn-with-smtpclient-in-powershell

But in the .Net Core implementation https://github.com/dotnet/corefx/blob/master/src/System.Net.Mail/src/System/Net/Mail/SmtpClient.cs only the fallback to IPGlobalProperties.GetIPGlobalProperties().HostName; is implemented.

Unfortunately, I get a SmtpException because my Smtp server requires fully-qualified hostnames:

image

Maybe we can find a solution by changing the SMTP server, but our admins say that FQDN check is a POSTFIX default setting, so I'm surprised I'm the only one having this problem.

Thanks

@MarcoRossignoli
Copy link
Member

Maybe better move issue to https://github.com/dotnet/corefx

@olmobrutall
Copy link
Author

Sorry, moved to https://github.com/dotnet/corefx/issues/33123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants