The server response was: 5.7.0 Authentication Required once I host it
I am using google SMTP and when I use it locally it works and it sends emails but when I host my website on amazon elastic beanstalk I receive this error
The server response was: 5.7.0 Authentication Required
I enabled the Less Secure Apps setting on google and I added all traffic on amazon outbound and inbound furthermore, I added the TCP port 587 on the outbound and inbound and I still get the same issue. Note(the website doesn't have SSL/TCL certification is it possible because of that)
See also questions close to this topic
-
Cascading databound <ajaxtoolkit:combobox> and <asp:dropdownlist> in asp.net
I have an
asp.net
search form that includes anajaxToolkit Combobox
and a standardasp DropDownList
. Both controls are bound to two separatedSqlDatasource
components.Something like this:
<ajaxToolkit:ComboBox ID="cbConvenzionato" runat="server" AutoCompleteMode="SuggestAppend" DropDownStyle="DropDownList" DataSourceID="sdsConvenzionati" DataTextField="nome" DataValueField="id" AutoPostBack="true" OnSelectedIndexChanged="cbConvenzionato_SelectedIndexChanged" /> <asp:DropDownList ID="ddlVeicoli" DataSourceID="sdsVeicoli" DataTextField="targa" DataValueField="id" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlVeicoli_SelectedIndexChanged" AppendDataBoundItems="true"> <asp:ListItem Text="TUTTI" Value="" Selected="True" /> </asp:DropDownList> <asp:SqlDataSource ID="sdsConvenzionati" runat="server" ConnectionString="<%$ ConnectionStrings:db %>" ProviderName="<%$ ConnectionStrings:db.ProviderName %>" SelectCommand=" SELECT id, nome FROM anag_convenzionati ORDER BY nome;" /> <asp:SqlDataSource ID="sdsVeicoli" runat="server" EnableCaching="false" CancelSelectOnNullParameter="false" ConnectionString="<%$ ConnectionStrings:db %>" ProviderName="<%$ ConnectionStrings:db.ProviderName %>" SelectCommand=" SELECT id, targa FROM veicoli_contratti WHERE ((@id_convenzionato IS NULL) OR (id_convenzionato = @id_convenzionato)) ORDER BY targa;"> <SelectParameters> <asp:ControlParameter Name="id_convenzionato" ControlID="cbConvenzionato" PropertyName="SelectedValue" Direction="Input" ConvertEmptyStringToNull="true" DbType="Int32" DefaultValue="" /> </SelectParameters> </asp:SqlDataSource>
There's also a third
sqldatasource
(sdsNoleggi
) that feeds agridview
but this's not a problem right now.In code behind I have two event handlers:
protected void cbConvenzionato_SelectedIndexChanged(object sender, EventArgs e) { sdsVeicoli.Select(DataSourceSelectArguments.Empty); Search(); } protected void ddlVeicoli_SelectedIndexChanged(object sender, EventArgs e) { Search(); } private void Search() { sdsNoleggi.Select(DataSourceSelectArguments.Empty); }
I tought in this way I should filter
ddlVeicoli
items after selecting an item incbConvenzionato
... but it's not working... why?If I look into
sdsVeicoli
SelectParameters
in debug I can seeid_convenzionato
being correctly set to selected value (id coming fromcbConvenzionato
) I bet also thatsdsNoleggi
dataset wiil be correctly updated with new values since I did this many times before. So why bound control it's not? I tried also to force addlVeicoli.DataBind()
aftersdsVeicoli.Select()
call ... but this had no effect. -
Swagger UI not working for REST API (asp.net web api2) application
I have asp.net mvc project with .NET Framework 4.7.2 and the same project contains asp.net web api2 controller in a separate folder : Controllers. The solution is legacy. The API are already in use in the PRODUCTION environment. Now I added the Swagger nuget package (Install-Package Swashbuckle -Version 5.6.0) to this existing project. Post that I see a SwaggerConfig.cs added to the App_Start folder of the Solution Explorer.
Here the asp.net mvc controllers are used by App1 pointing to the server: www.app1.com and asp.net web api2 controllers are used by another frontend angular app: App2 pointing to the server : www.app2.com
The complete deployment package for both App1 and App2 are hosted in IIS
Any request related to App1 is handled by www.app1.com and any api request related to App2 (Angular frontend) is handled by App1 only using IIS Rewrite rules at App2 level which redirect any api request to App1 only.
Now in this case when I tried to navigate to www.app1.com/swagger , I see it is loading the SwaggerUI for me, but when I tried to navigate to www.app2.com/swagger it is not working and instead of that it is loading the Angular frontend application
Here goes the App1 and App2 at IIS level:
Can anyone help me here by providing their guidance to fix this issue?
-
Cors error missing allow origin header. MailKit
I have
cors error missing allow origin header
error only on ONE post request. My CORS Policypublic void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddPolicy("AllowAllOrigins", builder => { builder.SetIsOriginAllowed(_ => true) .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); }); }); }
Every request work fine, but one POST request fails, it's really weird. Code in controller action which failed use MailKit and SMTP to send email, maybe that's cause
-
How to use EC2 Instance Profile in Nodejs application to access AWS Services?
I have a Nodejs application which runs on an EC2.
The EC2 has an instance profile attached to it.
How can I use the instance profile inside my Nodejs code so that my Nodejs code can access AWS Services like S3 bucket etc without using AWS Access Keys?
I found this link that's close to this topic but could not see any sample code provided there:
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-iam.html
-
redshift:GetClusterCredentials + dbuser + ${aws:username}
I have met a problem. The idea was to pass the federated
(IDP)
AWS
user name toRedshift
as login using temporary credentials in theAWS Redshift
query console. But the user should able to connect only to his Redshift user id. To use it, we did such a code.Redshift
has already all created before users.{ "Sid": "Sid", "Effect": "Allow", "Action": "redshift:GetClusterCredentials", "Resource": [ "arn:aws:redshift:eu-west-1:account_number:dbuser:cluster_name/${aws:username}", "arn:aws:redshift:eu-west-1:account_number:dbname:cluster_name/db_name" ] }
But
Redshift
uses only low letters in user id(useid = "user_test")
, and${aws:username}
returns only big letters("USER_TEST")
. In our case, we can not change the value in${aws:username}
, because it is coming in the end from theIDP
service. Is it possible to make an expression somehow to make it equals?Thank you! Ivan
-
Python - How can I convert S3 folders into JSON hierarchy?
I have created a list using boto3 that contains all the subfolders in my S3 bucket. The list is sorted as below:
s3_list = ['a', 'a/a1/a11', 'b', 'b/b1', 'b/b2', 'b/b2/b22']
I'm trying to convert this list into JSON hierarchy structure:
{ "root": [ { "name": "a", "path": "a", "child": [ { "name": "a1", "path": "a/a1", "child": [ { "name": "a11", "path": "a/a1/a11" } ] } ] }, { "name": "b", "path": "b", "child": [ { "name": "b1", "path": "b/b1" }, { "name": "b2", "path": "b/b2", "child": [ { "name": "b22", "path": "b/b2/b22" } ] } ] } ] }
Whats the best way/libraries to get this going in Python?
-
Wanted to send bulk emails using smtplib in python but I'm not able to send over 100 in one go. Is it possible to fix that using a loop?
import os import smtplib from email.message import EmailMessage import pandas as pd email_addr = os.environ.get('airful_email_addr') email_pass = os.environ.get('airful_email_pass') df = pd.read_csv(r'C:\Users\Clive\Desktop\new_devs_india.csv') contacts = df['email'].tolist() v = ', '.join(contacts) msg = EmailMessage() msg['Subject'] = 'Invitation for Job Hunt' msg['From'] = email_addr msg['bcc'] = ', '.join(contacts) msg.set_content("""\ Hello there, \n \n I hope you and your family are well! \n I am writing to you to introduce you to an innovative, new platform on behalf of the team at GeekTrust! \n \n GeekTrust helps in finding great jobs for software engineering professionals and onboarding them at some of the fastest growing Indian startups. Compensation and salaries are above market standards. \n \n The platform features coding challenges, exposure to open job positions at renowned companies and seamlessly manages the interviewing process - all in pursuit of giving you a great job hunting experience and land something really game changing for your career! \n \n Check it out here → Link : https://www.geektrust.in/?refToken=28cf61c2b9ba3de4002b27 \n \n Thank you, \n Subhro, \n On Behalf on GeekTrust""") msg.add_alternative("""\ <!DOCTYPE html> <html> <body> Hello there, <br><br>I hope you and your family are well! <br>I am writing to you to introduce you to an innovative, new platform on behalf of the team at GeekTrust! <br><br>GeekTrust helps in finding great jobs for software engineering professionals and onboarding them at some of the fastest growing Indian startups. Compensation and salaries are <i><b>above</b></i> market standards. <br><br>The platform features coding challenges, exposure to open job positions at renowned companies and seamlessly manages the interviewing process - all in pursuit of giving you a great job hunting experience and land something really game changing for your career! <br><br>Check it out here → <a href="https://www.geektrust.in/?refToken=28cf61c2b9ba3de4002b27">Link</a> <br><br>Thank you, <br>Subhro, <br>On Behalf of GeekTrust. </body> </html> """, subtype = 'html') with smtplib.SMTP_SSL('smtp.gmail.com', 465) as i: i.login(email_addr, email_pass) i.send_message(msg)
It seems that the limit for this script per email is 100, is there a way to loop in this script so that I can send it in batches? Any other way to send the whole csv data in one go is also appreciated.
Please note that my account limit for emails is 2000 per day. I have also not exceeded that. List contained around 800 odd email id's.
-
How to send emails via "smtpjs" in reactjs
I want to send a email via form whenever user clicks submit
and for that i use
smtpjs
package you can check the site in here https://smtpjs.com/in pure js we must add this line of code in html head tag
<script src= "https://smtpjs.com/v3/smtp.js"> </script>
and then we can use
Email.send({})
to send the emailbut for react
i tried to add the mentioned code(script tag) in head in
index.html
and tried to use it asEmail.send({})
andwindow.Email.send({})
and it didn't recognizeEmail
so my question is how can use the library in react since i added it in index.html -
Problem in SMTP setting in Wordpress live server with ProHost <unaux.com> to receive mails from Wordpress Contact Form
I'm facing problem to setup SMTP into Wordpress Contact from to get mails directly in my assigned Inbox. It's showing that "Your message has sent successfully and notified sender mail...." but unfortunately it is not showing anywhere either at Inbox or sender mail ID as notification. Can you please suggest me which SMTP to be assigned at the Form configuration? Is it to be or hosting site <unaux.com>?