Phil - Wednesday, June 16, 2010 3:48 PM:
I am trying my best to use ARAS to send emails on Server events... here is my server event code to send the email:
Innovator myInnovator = this.newInnovator();
Item toIdent = myInnovator.getItemById("Identity","A260EBEF6B634C7987142576F72889F3");
Item fromUser = myInnovator.getItemById("User","4933144709AD4F969D4535EB2C8C70B5");
string subject = "Test Email" ;
string body = "This is a test";
Item emailMsg = this.newItem("Email Message");
emailMsg.setProperty("subject",subject);
emailMsg.setProperty("body_plain",body);
emailMsg.setPropertyItem("from_user",fromUser);
if(this.email(emailMsg,toIdent) == false )
{
throw new Exception("email broke");
}
return this;
Seems simple enough.....but no matter what I do it won't send. I tried using the SMTP server as queue and setting up the Smarthost..... that didnt work.
I would like to point InnovatorServer.xml to my SMTP server, but that doesnt work either. I am thinking it is because there is nowhere for me to specify a user name and password for my Exchange Server.
On all of the other .NET apps I have written, I needed to specify a valid username and password in the SMTP connection string in order for this to work.
Is there any way in ARAS to specify that, or does it just always try to use Windows Authentication as the logged on user?
Phil - Wednesday, June 16, 2010 5:26 PM:
In Recent news: I was able to get an email to send.....but not by using my code above. I actually had to manually create an Email Message Item (from the TOC), and then use that Item in my code. For whatever reason, creating a new Email Message Item and then trying to send it (like in my code above), does not work as one would hope.
My question still stands about the whole username and password thing. That may come into play especially if someone tries to email from an outside location, but would still like to utilize a specific mail server.