Jump to content

SMTP is throwing an exception setting up an automation job to send an email with the below error: What may be the cause of this error I am using google SMTP?


Siphamandla Zolakhe
Go to solution Solved by David Boot-Olazabal,

Recommended Posts

System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. i12-20020a1c540c000000b003a2f2bb72d5sm12666443wmb.45 - gsmtp

  at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)

  at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)

  at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)

  at System.Net.Mail.SmtpClient.Send(MailMessage message)

  at Spotfire.Dxp.Automation.Tasks.Tasks.SendEmail.SendTheMail(TaskExecutionContext context, String smtpHost, String fromAddress, String messageBody, AttachmentsInfo attachmentsInfo)

Done

Link to comment
Share on other sites

  • 2 years later...

Hi David,
Thanks for the prompt reply!!

I am trying to use the Google SMTP server details in our environment. We are using the Spotfire14.0.1 version. The configuration details are attached in the screenshot.

Please let me know if I miss anything here.

SMTP configurations.png

Automation Job.png

Link to comment
Share on other sites

  • Solution

Hi Anusha,

The settings seem fine (checked with my own configuration), but I wonder about the password that you have used.
When I had to set up my gmail settings in the automation.config file, I also had some issues at first. As Google requires 2MFA for most applications, it doesn't accept the usual email username/password method for Spotfire.
To solve this, I had to create a specific app password in Google, to allow for the use of my gmail account in Spotfire. You can find more information on how to do this here: https://support.google.com/mail/answer/185833?hl=en.

I used this password (a 16-digit code) in the automation.config (you can encrypt this if you like) and since then it works perfectly fine.
If you have used a normal password for the gmail account, I would advise you to create an app password and use this as the password for your gmail account. That should solve the problem.

Kind regards,

David

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...