There are two problems with calling SmtpMail.Send.

First of all, you need to tell `mcs' in what DLL the class exists.  You
don't need to do this with `csc' because it provides several default
DLLs that it looks in.  Thus, your compile command should be:

        mcs -r System.Web.dll send_mail.cs

This will allow your program to compile.

The second problem has been alluded to already: SmtpMail.Send is a work
in progress.  Looking at the code, if you attempt to call SmtpMail.Send,
you'll get a `System.NotImplementedException'.

 - Jon

On Tue, 2002-06-11 at 03:25, [A]ndy80 - Andrea Grandi wrote:
    Hello
    
    I'm a new mono user. I'm doing some tests with mono. In particular I'm
    trying to use SmtpSend.
    
    When I try to compile this code:
    
    using System;
    using System.Web.Mail.SmtpMail;
    
    public class AG_SendMail
    {
        public static void Main()
        {
                string from = "[EMAIL PROTECTED]";
                string to = "[EMAIL PROTECTED]";
                string subject = "E-mail inviata da C#";
                string body = "<html><body>E-mail inviata da C# - con
    successo</body></html>";
                SmtpMail.Send(from, to, subject, body);
        }
    }
    
    I get this error:
    
    [shady@piccoli cs]$ mcs send_mail.cs 
    send_mail.cs(12) error CS0246: Cannot find type `SmtpMail'
    Error: Compilation failed
    RESULT: 1
    
    How can I solve this?
    
    Thank you,
    
    -- 
       ~            Piccoli Software
      ° °     http://www.piccolisoftware.cjb.net
      /V\      [EMAIL PROTECTED]
     // \\
    /(   )\  [A]ndy80 on #bluvertigo e #pistoia
     ^`~'^  [EMAIL PROTECTED] - http://www.ptlug.org
    
    GPG Key: http://www.ptlug.org/andy80_key.asc
    
    


_______________________________________________
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to