tags:

views:

503

answers:

2

First of all, I have already seen this post: nant mail issues but the only answer is not satisfactory (i.e.: doesn't work for me).

I am using NAnt to get latest version of source, upgrade version of the libraries and application, build the application, build the setups... all the usual things, I bet. I would like NAnt to send an email to some people confirming the conclusion of the build process; I've already checked the official (pretty ugly, IMHO) documentation for the task, but the example, once copied and customized, doesn't work.

This are the NAnt target and task I'm using:

<target name="sendMail" >
    <mail 
        from="[email protected]" 
        tolist="[email protected];[email protected]" 
        subject="Subject of email" 
        mailhost="smtp.gmail.com"
        message="Your new release is ready!">
    </mail>
</target>

The error message I get is:

530 5.7.0 Must issue a STARTTLS command first.

It looks like that the task was designed for use by an account whose provider doesn't need authentication; but what can I do if I must use an external smtp server which requires authentication (telling my boss I need an smtp server in house is not an option)?

Can anybody help/teach me?

Thanks in advance...

A: 

Were you able ti find answer for this ? I am using Gamil SMTP and nAnt Task does not take any username or password so how can I send email after the build completion or failure etc. I would appreciate if you have figured out and reply to my email.

Ocean
The only way I found, was to get the Nant.Core sources, copying the MailTask class into a new GMailTask and change a bit the ExecuteTask method; then copy the rebuilt dll in the Nant folder. You can find all the relevant informations to modify the ExecutaTask method here : http://www.shabdar.org/send-email-using-gmail-account-asp-net-csharp.html.Hope it helps, otherwise let me know (unfortunately I've lost the sources, but I could send you the compiled assembly)
Turro
A: 

that would be a great value-add to the NantContrib project. I am sure many would benefit if you could rebuild that and submit it.

funkymushroom