Send email from .Net – MAPI

You need to send an email from your thick client .Net app (winforms or WPF), but don’t want to mess with using MailMessage and configuring it to use a remote server etc.

Instead, you can use MAPI and just pop open a new message using your default installed email client (often outlook, but any mapi compliant email client will work).

This article on codeproject gives excellent coverage of this topic http://www.codeproject.com/Articles/17561/Programmatically-adding-attachments-to-emails-in-C

Beware that this is a good thing to use for occasional emails, not for heavy sending. MAPI has some known issues with memory management when called via interop from .Net, so if you make heavy use of it you will likely crash.

Also, since MAPI only works with locally installed email clients, it will not work with a web based one (ie, gmail).

 

Goodbye Mydomain.com

I’ve been using a nice low-cost registrar for many years now, mydomain.com (actually I started with dotregistrar which was later acquired by mydomain.)

I’ve stayed with them because:

-they gave me a special price, since I have so many domains

-they offer free dns

-they offer free anonymous whois services

With the quantity of names I keep, all these little savings add up and help with ownership costs a lot. 

Beginning last year though, problems started. 

-a DDOS took out their dns for over a whole day (not really their fault, sicne they were attacked)

-I began to notice that any time I make a dns change, it would not get updated. I’d have to open a ticket, be reassured it takes time to update, inform them that it’s not working and it’s been several days, get the silent treatment, call them, get escalated to next tier support, and finally find someone to help. This gets tiring as one might imagine. 

I kept asking when these DNS issues would be resolved, and I ware reassured that they are moving to a new platform, and once migrated everything will be great. 

Well, that finally happened a few weeks back. It was not great. At all. 

-about 75% of my dns settings got lost. So, most of my production websites suddenly became parking pages. Business emails stopped working. Hell broke lose. I called and tried to get help with this, and was told sorry it would take several days. So instead, I got to spend a day and a  half manually updating dns settings to get sites and email back online. Inexcuseable. 

-I apparently no longer get free anonymity on my domains. It’s ok to change pricing, but give me a heads up? I’ll move my names somewhere else before spending 9 bucks a year to add this service. I’ve requested changing this back to free, but all I get are “we’ll have to check with billing about this”. All stalling, no answers.

-I’ve had a support ticket open about this for WEEKS now. I get partial answers sometimes, but nothing that actually resolves anything. This is big. Support has never been this company’s strong suite, but it has become ridiculous now. 

-I will sometimes not renew a name before it expires (I’m busy), but that is ok because they have a grace period. Well now it looks like if I let a name expire, the dns gets reset after a few days. This is a horrible practice. I have a grace period for a reason, disrupting my properties in this way is unacceptable. I’m not even sure this is legal.

-When I try to renew a longish list of names, the system bogs out and crashes. It appears to put all the names in the querystring, and appears to get too long for the browser to handle. So then you get to go back and try selecting a smaller list and try again.

-And of course the small things – Like, when checking out my names, I can’t set a renewal period for the whole batch. No, I have to go through the whole list, often hundreds at a time, and select 1 year, 2 year, etc. I just want to set all to 1 year, like the old system did. Same thing for selecting whether you want anonymity or not- go through the entire list one by one. 

-Just now, after doing this for only 70ish names (so it wouldnt blow up), I finally hit the button to renew them. “Your transaction has been suspended for security purposes”. Great. Now I get to wait on the phone for a hour. (I waited for an hour and nobody ever answered. This was last week, so I’m still out of luck.)

-Performance is now bad in may spots. Go try to edit settings on a single domain, and you get the ajax spinner for far longer than should be needed. Do this for 50 names and you should plan to spend all day. 

I have another registrar I’ve been trying that has treated me well and I will be moving all my names to them as soon as time allows. It’s so unfortunate after owning thousands of domain names and spending over a decade with mydomain (and dotregistrar) things have turned out this way.

 

—–

Update- I’ve been spending weeks trying to get issues resolved with renewals (since I’m stuck renewing domains until I can move them off). Online support is worthless, and phone support won’t answer. Initially I tried renewing a larger batch of names, which claimed it needed to be reviewed by billing before it could be approved. In the interim, I found I could do renewals one at a time… try doing that with hundreds!

Well sure enough, over a week later, a big batch of renewals came through. Except these weren’t the ones I initially tried to renew- the list includes names I’d decided to let expire. Oh, and now a bunch of names have auto-renew turned on, which I didn’t do. I update my ticket once more and actually get a reply- “please send us the list of domains you are having issues with”. Um, at this point, pretty much all of them? Just another stall tactic from support that is either unempowered or just doesn’t care.

Also I kept asking (for weeks) about setting my domain anonymity back to free (instead of 8.99/year) and I got an update on a ticket that this had finally been done. But, go to renew more and what do you know- still shows 8.99.

—–

Another update: so mydomain apparently decided to set all my domains to auto renew. I didn’t ask for this, and as a result a bunch of names I wished to let expire are now getting auto renewed. At this point though, it’s worth it to let the names get auto renewed and get a few extras in there just so I don’t have to mess with the horrible slow crashy process required to manually renew. 

Except that today, I noticed a few names were not showing the correct page. Log into mydomain, and sure enough – probably 80% of them were being auto renewed, but somehow a batch of about 15, although set to autorenew=true, had expired. And just as before, one day after expiration the dns settings get screwed up. 

Back to manually renewing these. Just tried a small batch of 20 and the site crashed on my twice while trying to renew. I can’t even make up a user experience this bad. 

The saga continues… 

Copy path to file

When I’m working with files of any kind, I usually have an explorer window open to the path(s) containing those files. So then when I want to open one of the files in another app (and one that doesnt support drag-and-drop), I’m forced to go through the whole file, open, dig through file system, dig through file list, oh there it is… click and open. I’ve often sped this up by copying the path from the open explorer window and pasting it into the file open dialog just to at least get me to the right folder, but then it’s back to digging through what might be hundreds of files.

Why can’t I just copy the path of a file (instead of copying the file itself) and then paste the path directly into the file open prompt?

Well, turns out you can, in Vista and Windows 7 (and likely 8).  

Simply: 

Hold the Shift key, right click on the file, and then select “Copy as path”

Wish I’d known that several years ago..

rootkits suck

Yesterday my pc pops up a message stating that I will need to reboot the pc in order to disable UAC. Ugh. That’s no good.

Ran windows defender, and it found nothing (or it found something, but irrelevant).

Later, i noticed one of my websites had a strange floating ad in the lower left corner. Checked a few more sites and some others showed this same ad… so I knew we had a problem. The ads were from a few “second tier” ad services, such as cpxinteractive.com or xtendmedia.com. And, the ads seems to often (or always) be placed in a div with id of _rjkkvyjkph – <div id=”_rjkkvyjkph”> (unwanted ad code here etc…)</div>

Ran Malwarebytes to dig it out. It found some rootkit thing that it removed and then rebooted. But, the ads continued to show up in the webpages.

Decided to check the hosts file. I have a tool from Amazify I use for this (Hosts file editor). Opened the file and it looked like a generic empty hosts file… which is actually not good in my case, as I have a number of hardcoded entries usually. Then I noticed the scrollbar showed the file was very long. SCroll down far enough, and sure enough, you find this:

66.185.21.82 www.google-analytics.com.
66.185.21.82 ad-emea.doubleclick.net.
66.185.21.82 www.statcounter.com.
66.185.21.82 connect.facebook.net.
93.115.241.27 www.google-analytics.com.
93.115.241.27 ad-emea.doubleclick.net.
93.115.241.27 www.statcounter.com.
93.115.241.27 connect.facebook.net.

Easy enough, we’ll delete these and be back in business. But, the editor tool crashed when I tried to save the file, so apparently some other tricks are being employed here.

I tried running Unlocker on the file, but this didnt help things.

Explore to the c:\windows\system32\drivers\etc folder, and I notice there is a hosts.txt file in there. Strange, because hosts file is normally extensionless. Open this file and it looks like it has normal hosts file contents. But apparently it’s benn created a decoy- the real file has been hacked all kinds of ways to keep you from repairing it. It is hidden, readonly, and set to be a system file. But even worse, the ownership and permissions have been messed with to prevent even an admin from editing and saving the file.

After a bit of digging online, I found these commands you can run from an admin command prompt which will reset the permissions back so you can edit it once more:

CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /G BUILTIN\Users:R
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G “BUILTIN\Power Users:R”
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G BUILTIN\Administrators:F
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G “NT AUTHORITY\SYSTEM:F”
ATTRIB.EXE -S -H +A -R C:\WINDOWS\system32\drivers\etc\hosts

After doing this, I was finally able to save the changes I needed to the hosts file.

I then cleared the caches in my browsers and tried viewing my sites again, but these stupid ads continued to show up. Using fiddler I noticed that the google analytics file was being downloaded and refreshed, but the domain was still resolving to a hacked ip. So I finally flsuhed the dns cache and this cleared things up – by using, again from an admin command prompt:

ipconfig /flushdns

 

So. Now perhaps I can try to get some work done today?