Ok, I just wrote it myself.  Could someone please add this to the
official code?  I verified that it compiles with .NET 1.1 AND works.  If
I can integrate it into the main code myself, please let me know.

This first part is already in Log.cs, but the code after that needs
added in.
------------------------------------------------------------------
                // create message to send
                MailMessage mailMessage = new MailMessage();
                mailMessage.From = GetPropertyValue(properties, "from",
null);
                mailMessage.To = GetPropertyValue(properties, prefix +
".to", null);
                mailMessage.Subject = GetPropertyValue(properties,
prefix + ".subject",
                    (success) ? "Build Success" : "Build Failure");
                mailMessage.Body = _buffer.ToString();
-------------------------------------------------------------------

                                                        string
smtpUsername;
                                                        string
smtpPassword;

                                                        smtpUsername =
GetPropertyValue(properties, "username", null);
                                                        smtpPassword =
GetPropertyValue(properties, "password", null);

                                                        if(smtpUsername
!= null)
                                                        {
        
mailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/smtpa
uthenticate"] = 1;
        
mailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/sendu
sername"] = smtpUsername;

        
if(smtpPassword == null)
                                                                {
        
throw new ApplicationException("SMTP username specified without a
password");
                                                                }
                                                                else
                                                                {
        
mailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/sendp
assword"] = smtpPassword;
                                                                }
                                                        } 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Young,
Jason (GE Indust, GE Fanuc)
Sent: Thursday, March 09, 2006 2:31 PM
To: [email protected]
Subject: [NAnt-users] MailLogger credentials

Is there any way to use the MailLogger to send an email with
credentials/authentication?  I have a build script that runs on a few
different machines, and I want it to be able to send using a remote
email server, but it requires authentication.

Surely someone else has had to do the same thing.  Any suggestions?

Thank you!
Jason


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend the
live webcast and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to