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

enable sasl authentification #173

Open
samirnext opened this issue Feb 7, 2018 · 8 comments
Open

enable sasl authentification #173

samirnext opened this issue Feb 7, 2018 · 8 comments

Comments

@samirnext
Copy link

hi ,
i use postal to send mail from c# mvc application
i need to use email with SASL authtification and the default configuration is not working for me

how i can fix this issue

thanks for advanced

@phantomtypist
Copy link

Hi @samirnext!

Can you help me out? Would you be able to provide some example code or even create a throw-away repo or a GitHub Gist with a sample app containing the pertinent code that isn't working? Don't include anything sensitive like credentials for your SMTP account. The gist is, do you have a reproduction case for me that I can use and go off of?

Also, would you be able to tell me what SMTP provider you are trying to authenticate against? (e.g. Google, Amazon SES, etc.)

@phantomtypist
Copy link

I'm just going to leave a little more information here for you to see if you covered your bases.

At my work all of the SmtpClient configuration is done in the web.config/app.config files. We don't actually hard-code anything in the code. If you have the correct authentication and SmtpClient configuration settings in your web.config/app.config file, then Postal should just work out of the box, especially with let's say Gmail and Sasl.

References:

So in the "network" element, you need to make sure:

  • defaultCredentials = false
  • enableSsl = true
  • Set the host, username, and password properties.

If you haven't tried those things go ahead and play around with that and let me know if that fixes your issue or not. If I don't hear back from you by the end of February I'll consider the issue closed.

@samirnext
Copy link
Author

Hi,
when i use dotnet smtp (without postal ) it work by adding this lines :

            ServicePointManager.ServerCertificateValidationCallback = (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => true;
            SmtpConexiune.DeliveryMethod = SmtpDeliveryMethod.Network;
            mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
            SecurityProtocolType oldSecurityProtocol = ServicePointManager.SecurityProtocol;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
            SmtpConexiune.Send(mail);
            ServicePointManager.SecurityProtocol = oldSecurityProtocol;

how i can enable the tls security protocole in tha app.config ?

thanks

@samirnext
Copy link
Author

hi,
i resolve this issue but adding this line before Send() methode
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
thanks

@josephflyer917
Copy link

Hi there! It sounds like you need to configure SASL authentication for sending email in your C# MVC laser application using Postal. You might want to check your SMTP settings and credentials. Ensure they match your email provider's requirements. If you still face issues, consider providing more details for specific help. Good luck.

@Fredricksonjustin39
Copy link

Sure, I'd be happy to help with enabling SASL authentication. Could you please provide more specific details about the system or platform you are referring to? This will allow me to provide you with accurate instructions movers.

@Justinhandrickson123
Copy link

Enabling SASL authentication is a crucial step for enhancing security in various systems and applications. If you have any specific questions or need guidance on how to enable SASL authentication in a particular context Investement Visa, please provide more details, and I'd be happy to assist further.

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

6 participants
@phantomtypist @samirnext @josephflyer917 @Fredricksonjustin39 @Justinhandrickson123 and others