I'm currently working on sending an email through a timer script in the gateway event scripts section. To do this I am using the system.net.sendEmail() function. However, when I attempt to send the email through the SMTP server I've configured I am being presented with the following error:
com.sun.mail.smtp.SMTPSendFailedException: 554 5.2.252 SendAsDenied
From this code:
body = "<HTML><BODY><H1>This is a big header</H1>" body += "And this text is <font color='red'>red</font></BODY></HTML>" recipients = ["...@gmail.com"] title = "Here is the email" smtp_server = "Test_Email" system.net.sendEmail(smtpProfile=smtp_server, fromAddr="...@gmail.com", subject="Here is the email!", body=body, html=1, to=recipients)
Note: the emails used in the script are real and used regularly.
I should note that when I use the exact same SMTP server through a pipeline the emails will send as appropriately needed. The issue is I cannot use the pipeline, I need to be able to run these emails through a script. This script does not necessarily need to be in the gateway event scripts either.