Click here to Skip to main content
14,326,160 members
   

ASP.NET

 
GeneralRe: Why can't I Publish web site error warn ? Pin
Member 245846711-Aug-19 18:27
memberMember 245846711-Aug-19 18:27 
AnswerMessage Closed Pin
6-Aug-19 1:36
memberabhinavshashtri156-Aug-19 1:36 
AnswerMessage Closed Pin
6-Aug-19 1:35
memberabhinavshashtri156-Aug-19 1:35 
QuestionASP.net postback url problem Pin
UDTWS5-Aug-19 1:26
memberUDTWS5-Aug-19 1:26 
AnswerRe: ASP.net postback url problem Pin
Vincent Maverick Durano5-Aug-19 6:55
mveVincent Maverick Durano5-Aug-19 6:55 
AnswerRe: ASP.net postback url problem Pin
jkirkerx5-Aug-19 12:48
professionaljkirkerx5-Aug-19 12:48 
QuestionServer-side Blazor and IE11 Pin
MSBassSinger2-Aug-19 5:57
professionalMSBassSinger2-Aug-19 5:57 
Question.Net Core V2.2 - Sending email or gmail using OAuth2 or secure settings in Gmail in the background without browser auth Pin
jkirkerx1-Aug-19 12:28
professionaljkirkerx1-Aug-19 12:28 
I thought this would be pretty simple to do, but has turned into a circular headache.

It's hard to find info on the internet on this subject, for most are using MailKit and MimeKit, others using SendGrid.
Plus I read that SmtpClient has been obsoleted as well with MailKit being reccomended.

So I have my secrets file working,
My Google OAuth2 Credentials have been tested and works.
Altered my Startup.cs to add Google credentials to services.
Altered my Startup.cs to services.AddAuthentication().AddGoogle
I did the example that opens up the browser to a Google Auth Page, writes the token with successful auth.

So here is my circular headache ....
Using Nuget MailKit/MimeKit, it doesn't register with .Net Core V2.2
Using Nuget SendGrid, same thing, doesn't register, get the caution or warning icon in dependencies nuget.

I can do this now, but I don't have any code to actually send the email.
var secrets = new Google.Apis.Auth.OAuth2.ClientSecrets
{
    ClientId = Environment.GetEnvironmentVariable("GMailClientId"),
    ClientSecret = Environment.GetEnvironmentVariable("GMailClientSecret")
};

var googleCredentials = await GoogleWebAuthorizationBroker.AuthorizeAsync(secrets, new[] { GmailService.Scope.MailGoogleCom }, email, CancellationToken.None);
if (googleCredentials.Token.IsExpired(SystemClock.Default))
{
    await googleCredentials.RefreshTokenAsync(CancellationToken.None);
}

I'm not sure which way I should proceed.
I can't find any references, or documentation for .Net Core V2.2

I must admit that the SendGrid SAS looks pretty cool for sending email from my website.
Any help would be appreciated!
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: .Net Core V2.2 - Sending email or gmail using OAuth2 or secure settings in Gmail in the background without browser auth Pin
Afzaal Ahmad Zeeshan1-Aug-19 14:37
mveAfzaal Ahmad Zeeshan1-Aug-19 14:37 
GeneralRe: .Net Core V2.2 - Sending email or gmail using OAuth2 or secure settings in Gmail in the background without browser auth Pin
jkirkerx2-Aug-19 6:50
professionaljkirkerx2-Aug-19 6:50 
GeneralRe: .Net Core V2.2 - Sending email or gmail using OAuth2 or secure settings in Gmail in the background without browser auth Pin
jkirkerx2-Aug-19 11:45
professionaljkirkerx2-Aug-19 11:45 
AnswerThought I had it, Failed to open browser when running in Docker Container Pin
jkirkerx2-Aug-19 12:50
professionaljkirkerx2-Aug-19 12:50 
AnswerFigured it out [solved] Pin
jkirkerx3-Aug-19 13:44
professionaljkirkerx3-Aug-19 13:44 
GeneralRe: Figured it out [solved] - New Code Pin
jkirkerx5-Aug-19 13:22
professionaljkirkerx5-Aug-19 13:22 
QuestionInsert Date Interval Pin
Bartt_dmr25-Jul-19 10:31
memberBartt_dmr25-Jul-19 10:31 
AnswerRe: Insert Date Interval Pin
Richard Deeming25-Jul-19 10:49
mveRichard Deeming25-Jul-19 10:49 
QuestionObject reference not set to an instance of an object. Pin
Darwin Ahmed21-Jul-19 12:06
memberDarwin Ahmed21-Jul-19 12:06 
AnswerRe: Object reference not set to an instance of an object. Pin
phil.o21-Jul-19 19:50
mvephil.o21-Jul-19 19:50 
AnswerRe: Object reference not set to an instance of an object. Pin
ZurdoDev24-Jul-19 9:10
professionalZurdoDev24-Jul-19 9:10 
QuestionChange Value of HttpContext.Current.User Pin
MadDashCoder21-Jul-19 4:26
memberMadDashCoder21-Jul-19 4:26 
AnswerRe: Change Value of HttpContext.Current.User Pin
Richard MacCutchan21-Jul-19 6:42
protectorRichard MacCutchan21-Jul-19 6:42 
AnswerRe: Change Value of HttpContext.Current.User Pin
Afzaal Ahmad Zeeshan21-Jul-19 6:51
mveAfzaal Ahmad Zeeshan21-Jul-19 6:51 
AnswerRe: Change Value of HttpContext.Current.User Pin
ZurdoDev24-Jul-19 9:12
professionalZurdoDev24-Jul-19 9:12 
QuestionQuery timing out, help please!!! Pin
samflex19-Jul-19 8:38
membersamflex19-Jul-19 8:38 
AnswerRe: Query timing out, help please!!! Pin
ZurdoDev19-Jul-19 10:14
professionalZurdoDev19-Jul-19 10:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.