I've been tearing my hair out all morning trying to figure out this same problem. I have my email client set to Mail in iPhoto. Looking in account preferences in Mail I saw that they were different from the preset preferences in iPhoto account preferences. The differences were the ports and whether or not the SSL box was checked. I tried changing the iPhoto ports to the same ones that were in Mail. I tried different ports entirely. I tried checking and unchecking the SSL box.
Port in Mail was 993. SSL was checked.
Default port in iPhoto was 587, SSL unchecked.
What finally worked for me in iPhoto was leaving the port at the default - 587 - and checking the SSL box.
Go figure.