Also, you must set sendusing to 2 for authentication to work at all, and the if clause for the smtpPassword is reversed.
My current hacked version is lacking the faulty #if's, but at least sends email...: string smtpUsername = GetPropertyValue(properties, "smtp.username", null, false); if (smtpUsername != null) { mailMessage.Fields[cdoNamespaceURI + "sendusing"] = 2; mailMessage.Fields[cdoNamespaceURI + "smtpauthenticate"] = 1; mailMessage.Fields[cdoNamespaceURI + "sendemailaddress"] = mailMessage.From; mailMessage.Fields[cdoNamespaceURI + "sendusername"] = smtpUsername; } string smtpPassword = GetPropertyValue(properties, "smtp.password", null, false); if (smtpPassword != null) { mailMessage.Fields[cdoNamespaceURI + "sendpassword"] = smtpPassword; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users