08-08-2012 06:37 PM
Hey all,
I'm currently working on a way to send an email, and attach it to a contact in ACT! through an MVC website. I was initially trying to use the ActApplication object (Act.UI.ActApplication), and the SendEmailToContact method, but I don't think this is exactly what I want anymore. It appears I need to create this as a plugin or something similar, but that seems like tons of overhead for my needs. Really all I want is to send a pre-created email, and have it attach (as an email including attachments) to a specific contact that I'm sending to.
Does anyone have an example of doing this? I'm able to get a ContactList object with the contact I want to email, and I have the email created, so all I need is some way of sending an email and putting a copy of it into ACT! on the contact's history. I don't want ACT! to even need to be opened, which is why I don't think the Act.UI.ActApplication is for me...
Thanks!
Mike
08-08-2012 09:06 PM
Ok, the method I found is below:
I can't seem to get it working correctly though. I am getting a ContactList object (contact), and you can see the rest of the code, but it always returns false for m, and doesn't add the email to the contact in ACT!. Does anyone have any suggestions?
String[] contactid = { contact[0].ID.ToString() }; Act.ActFramework framework = new Act.ActFramework();
Boolean m = framework.Histories.AttachEmailToContact(contactid, @"C:\test\test.eml", "test subject", DateTime.Now);
08-09-2012 05:48 AM
Ughhhh, don't try to code late at night. Turns out I was saving the eml file to C:\test.eml, not C:\test\test.eml... everything's working now.
07-30-2013 04:24 PM
what is wrong with my code?
07-30-2013 07:20 PM
@haolle wrote:what is wrong with my code?
I might be wrong (just guessing really, as I don't have the project open), but I think the ActContact ID needs to be a string array, not just a string. Try setting it the same way I do in the post above and see if that works...
07-30-2013 07:29 PM