Error Sending Email

Error Sending Email

  

Hello,


When i try to send the email, i getting this error:

In my ServiceCenter configuration i has this:


and i put the e-mail and password correct and i put the option "Less Secure Apps" in "On"


can someone help me?


Many Thanks


Hi Thiago,
Can you look for this error in Service Center and give a more detailed error stack trace. It looks like the SMTP server is returning an error.

Kind regards,
Martijn Habraken

You need to enable your "application" in gmail configuration for him to allow you to send the mail.

https://support.google.com/accounts/answer/6010255?hl=en

Cheers.

Eduardo Jauch wrote:

You need to enable your "application" in gmail configuration for him to allow you to send the mail.

https://support.google.com/accounts/answer/6010255?hl=en

Cheers.


I already do that

Martijn Habraken wrote:

Hi Thiago,
Can you look for this error in Service Center and give a more detailed error stack trace. It looks like the SMTP server is returning an error.

Kind regards,
Martijn Habraken


here the print:


Eduardo Jauch wrote:

You need to enable your "application" in gmail configuration for him to allow you to send the mail.

https://support.google.com/accounts/answer/6010255?hl=en

Cheers.

if you prefer read:


Error of Service Center

Error creating Email. The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.HttpGetContent(String ssUrl, String method, String contentType, String userAgent, Cookie cookie, QueryParameter[] parameters, String& ssContent, String& ssContentEncoding)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailHelper.HttpPost(String ssUrl, QueryParameter[] parameters, String userAgent, Cookie cookie, String& ssContent, String& ssContentEncoding)
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailProcessor.SendEmailRequest(String url, String from, String to, String cc, String bcc, Int32 activityId, Int32 tenantId, Boolean storeContent, EmailType type) On 
   at OutSystems.HubEdition.RuntimePlatform.Email.EmailProcessor.SendEmailRequest(String url, String from, String to, String cc, String bcc, Int32 activityId, Int32 tenantId, Boolean storeContent, EmailType type)
   at ssAgent_CS.Actions.ActionCreateInvite(HeContext heContext, Int32 inParamUserId, Int32 inParamInviteType)
   at ssAgent_CS.Actions.ActionCreateOrUpdateAgents(HeContext heContext, Int32 inParamUserID, ENUserEntityRecord inParamUser, ENAgentDetailsEntityRecord inParamUserDetails, Int32& outParamUserIdOutput)
   at ssAgent_CW.RsseSpaceAgent_CS.MssCreateOrUpdateAgents(HeContext heContext, Int32 inParamUserID, IRecord inParamUser, IRecord inParamUserDetails, Int32& outParamUserIdOutput)
   at ssAgent_CW.Flows.FlowAgents.WBlkAgentDetail.CommandSave(HeContext heContext)


Solution

Thiago,

Yes, this is an error from gmail.
He is not allowing you to send the email.

If I am not wrong, the mail sender also needs to be approved: https://support.google.com/mail/answer/22370?hl=en

Are you sending from the mail of the account being used or a different one?

Cheers


Solution

Eduardo Jauch wrote:

Thiago,

Yes, this is an error from gmail.
He is not allowing you to send the email.

If I am not wrong, the mail sender also needs to be approved: https://support.google.com/mail/answer/22370?hl=en

Are you sending from the mail of the account being used or a different one?

Cheers



Yes i'm, as you can see in configuration

Thiago Mari wrote:

Eduardo Jauch wrote:

Thiago,

Yes, this is an error from gmail.
He is not allowing you to send the email.

If I am not wrong, the mail sender also needs to be approved: https://support.google.com/mail/answer/22370?hl=en

Are you sending from the mail of the account being used or a different one?

Cheers



Yes i'm, as you can see in configuration

I think I wasn't clear.

The sender of the mail (you define in the SendMail statement) or the default mail must be enabled in the gmail account. Otherwise, the gmail will prevent it from being sent due security issues with impersonating, etc.

So, the email you're trying to send, the sender is the gmail account you setup or is a different one? (From the configuration image you showed is not possible to see that).

Cheers.


Eduardo Jauch wrote:

Thiago Mari wrote:

Eduardo Jauch wrote:

Thiago,

Yes, this is an error from gmail.
He is not allowing you to send the email.

If I am not wrong, the mail sender also needs to be approved: https://support.google.com/mail/answer/22370?hl=en

Are you sending from the mail of the account being used or a different one?

Cheers



Yes i'm, as you can see in configuration

I think I wasn't clear.

The sender of the mail (you define in the SendMail statement) or the default mail must be enabled in the gmail account. Otherwise, the gmail will prevent it from being sent due security issues with impersonating, etc.

So, the email you're trying to send, the sender is the gmail account you setup or is a different one? (From the configuration image you showed is not possible to see that).

Cheers.


I have one e-mail in sender and another in Email Widget (field To)


The default sender will be used only if you don't fill the From of the SendMail statement.

If the one used is not the same mail you used for the gmail setup of the smtp, the gmail will not allow you to send the mail.
In order for you to be able to use this mail (if different from the gmail account you used in the SMTP setup), you need to enabled this mail to send emails for this gmail account, in the gmail account (link I posted before).

The email you use in the From or Default sender is the same as the one you used as user/pass for the smtp configuration?

Cheers.

Eduardo Jauch wrote:

The default sender will be used only if you don't fill the From of the SendMail statement.

If the one used is not the same mail you used for the gmail setup of the smtp, the gmail will not allow you to send the mail.
In order for you to be able to use this mail (if different from the gmail account you used in the SMTP setup), you need to enabled this mail to send emails for this gmail account, in the gmail account (link I posted before).

The email you use in the From or Default sender is the same as the one you used as user/pass for the smtp configuration?

Cheers.


Hi,


yes is the same, i not put in widget any email in field From, and the username and the default email was the same in service center


Ok, 

I just tested.
Gmail will not send the email if you don't put a sender FROM in the SendMail statement.

This solved the problem in my test here.

Cheers.

Eduardo Jauch wrote:

Ok, 

I just tested.
Gmail will not send the email if you don't put a sender FROM in the SendMail statement.

This solved the problem in my test here.

Cheers.

Here?

Yes. In the FROM field. You need a sender there, that is the same as the account you use in the SMTP or that is enabled in the account.

Eduardo Jauch wrote:

Yes. In the FROM field. You need a sender there, that is the same as the account you use in the SMTP or that is enabled in the account.

i already put as you can see, and appear the error mesage



The same email in configuration:



Sorry Thiago.

If you enabled in gmail account the less secure option, and is using in the sender of  the SendMail the same account, the only other thing I can think of is that you typed the wrong password...

Here it is working as expected. Gmail account, same configuration.

Your's a cloud environment? Enterprise or Personal? I tested in Personal. Should work on both.

Can you try this account at your personal to see if it works?

Eduardo Jauch wrote:

Can you try this account at your personal to see if it works?

In my personal was working, but in work server was not


The server is a cloud or an onpremises?
Is it behind firewall, proxy, etc?
Maybe the infrastructure is blocking your mail somehow?

Eduardo Jauch wrote:

The server is a cloud or an onpremises?
Is it behind firewall, proxy, etc?
Maybe the infrastructure is blocking your mail somehow?

i guess is blocking but is weird because i can send "normaly" email but using the widget from my page i can not..



That's because it is not your page that is sending the mail, but the server.
If the server firewall, etc, is blocking the port or something like that, you will not be able to send the mail than.

Eduardo Jauch wrote:

That's because it is not your page that is sending the mail, but the server.
If the server firewall, etc, is blocking the port or something like that, you will not be able to send the mail than.

maybe that, anyway, many thanks to help!!


Cheers


Not a problem.

Sorry for not being able to help you find an easy solution.
Check with yout infra-structure team if they can see what is blocking the mail.

Cheers!