Sending an email through c# with a custom domain from gmail
Asked Answered
L

1

6

So... I have a project in Visual Studio 2015, coded in C#, that sends emails, everything works fine with commom gmails and hotmails, SSL enabled, ports, etc... They are able to send emails and to authenticate.

But now my studio has a gmail custom domain, as such [email protected], so I used the same properties I would to send a normal gmail.

And then, I get an error 5.1.1, The SMTP server requires a secure connection or the client was not authenticated. All other gmails are working.

Do I need to change the smtp server? The port? Tried everything so far... no help.

PS: Yes I have enabled low secure apps on gmail.

Litterbug answered 30/6, 2016 at 21:57 Comment(3)
What mail server are you using? It looks like you need to set Use Network Credential to true for custom domain while using gmail set Network Credentials to false.Okay
So... Are you referring to the UseDefaultCredentials property? Because I'm already using a NetworkCredentials, and I have set that property to true and false... Nothings changes... ;( The thing is, the domain is a custom domain, but it is a gmail-email, and it seems the smtp is gmail too... But I can't get it to sign in...Litterbug
SMTP is a protocol defined by the IEEE as part of the RFC standards. SMTP supports secure and non-secure email and uses a different port number for secure and non-secure. SMTP has lots of options and each e-mail server uses different options. You should be able to send to your custom domain through your gmail account. I don't know what options your custom domain supports so I can't give a specific solution.Okay
S
0

Checkout this tutorial I think it has what you need...

http://www.afterlogic.com/mailbee-net/docs/advanced_smtp_connections.html

please if I helped you and the problem solved mark my answer as the question answer...

Schall answered 30/6, 2016 at 22:37 Comment(1)
Not quite, it's kinda cool, but I'm already using System.Net.Mail, I don't wanna change my whole system, just solve this issue... Thanks anywaysLitterbug

© 2022 - 2024 — McMap. All rights reserved.