This blog (and the sites here, CFLib, CFCZone, RSSWatcher) all use MailEnable for their mail server. I was setting up a new listserv today (more on that later) and was wondering if there was a way to let ColdFusion add a list member. I figured I'd probably have to append to some text file - but I was worried about the potential issues that could cause. Turns out - ME actually has a COM interface. All their demos are in ASP and PHP (sigh), but I was able to add a member using the code below:
<cfset mel.AccountName ="acadianammug.org">
<cfset mel.ListName ="LafayetteTech">
<cfset mel.ListMemberType = 1>
<cfset mel.Status = 1>
<cfset mel.Address ="[SMTP:" & trim(form.addmember) &"]" >
<cfset result = mel.AddListMember()>
If the result is 1, then everything worked fine. The only odd thing is that a user added this way will not get a confirmation email. Therefore, I just send them an email myself.