This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Email Notification via Server Method

Eggator - Wednesday, March 2, 2011 3:42 PM:

Hi everyone,

i recently tried to send an email via Server Method. I did everything like in the example of the programmers guide. I got an item of type identity to which I try to send the email. For testing purposes I used the the same identity for the "fromUser" identity.

For some reason I alway get into the error handeling part. Dont know, the email doesnt get sended


Item idnt =innovator.getItemById("Identity","myId")
Item fromUser = innovator.getItemById("Identity","myId")

string subject = “Part promotion notification”;
string body = "Test"

Item email_msg = this.newItem( “Email Message” );
email_msg.setProperty( “subject”, subject );
email_msg.setProperty( “body_plain”, body );
email_msg.setPropertyItem( “from_user”, fromUser );
// Finally send the email
if( this.email( email_msg, idnt ) == false )
{
// Error handling
...
}

 

Anyone got a clue what i'm doing wrong? innovator is the instance of the Innovator defined a bit above the code. So its not that i havent defined that.

 

Thank you for your help



kngo - Wednesday, May 15, 2013 2:54 PM:

Hello, I was running into this issue as well.  Sean from Aras provided some valuable help.

The email item is of type "EMail Message"    Make sure the "M" is captialized.

change this line: Item email_msg = this.newItem( “Email Message” );

to  Item email_msg = this.newItem( “EMail Message” );