Community
Showing results for 
Search instead for 
Do you mean 
Reply

Sending email through ACT from a website (MVC)

New Member
Posts: 19
Country: USA

Sending email through ACT from a website (MVC)

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

New Member
Posts: 19
Country: USA

Re: Sending email through ACT from a website (MVC)

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);
New Member
Posts: 19
Country: USA

Re: Sending email through ACT from a website (MVC)

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. 

Tuned Listener
Posts: 14
Country: Australia

Re: Sending email through ACT from a website (MVC)

what is wrong with my code?

 

2.JPG

New Member
Posts: 19
Country: USA

Re: Sending email through ACT from a website (MVC)


haolle wrote:

what is wrong with my code?

 

2.JPG


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...

Tuned Listener
Posts: 14
Country: Australia

Re: Sending email through ACT from a website (MVC)

you are right. i have sorted it out.
thanks.