Send emails from a C# Method not working
Hello,
I am trying to send an email from within a C# method but I am not receiving the message in my email. My code is made up of trying to check a url and then return if the url returned with an OK status or a 404 Error. When I get to the part where I want to send the email to myself it runs the code but I do not receive the message. Below is a snippet of my code. The result boolean value is returning true. Any idea what could be wrong?
Item fromUser = this.newItem("User", "get");
fromUser.setProperty("login_name", "admin");
fromUser = fromUser.apply();
//Get email message
Item email_msg = this.newItem("EMail Message", "get");
email_msg.setProperty("name", "ARAS Job Scheduler");
email_msg = email_msg.apply();
email_msg.setProperty("subject", "Series Website Check " + DateTime.Now.ToString());
email_msg.setProperty("body_plain", messageBody);
email_msg.setPropertyItem("from_user", fromUser);
//Get admin Identity
Item iden = this.newItem("Identity", "get");
iden.setProperty("name", "Joshua Bowden");
iden = iden.apply();
//return inn.newError(email_msg.ToString());
bool result = this.email(email_msg, iden);
1. Does your User item contain the required email address?
A: My user has the correct company email address.
2. Do you have checked your Spam folder?
A: Nothing in there.
3. Does your Email Message items contains the correct "From User"?
A: We are using the default Innovator Admin user.
***Solution***
I switched the "From User" to myself and I was able to receive the email. I am assuming that it was not working because the Innovator Admin user did not have an email registered to it.