[Mono-list] Testing SmtpSend

Jonathan Pryor jonpryor@vt.edu
11 Jun 2002 06:29:38 -0400


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 = "andy80@ptlug.org";
    		string to = "andy80@ptlug.org";
    		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\      piccolisoftware@pegacity.it
     // \\
    /(   )\  [A]ndy80 on #bluvertigo e #pistoia
     ^`~'^  andy80@ptlug.org - http://www.ptlug.org
    
    GPG Key: http://www.ptlug.org/andy80_key.asc