okay,
I tried the code below and this is not working in ms.net too.
So that I tried the next code and is working in .net but in mono no :(

(this code is using the obsolete namespace System.Web.Mail)

MailMessage mailMsg = new MailMessage();
            mailMsg.From = "[EMAIL PROTECTED]";
            mailMsg.To = to;
            mailMsg.Cc = cc;
            mailMsg.Subject = subject;
            mailMsg.BodyFormat = MailFormat.Text;
            mailMsg.Body = body;
            mailMsg.Priority = MailPriority.High;

            // Smtp configuration
            SmtpMail.SmtpServer = "smtp.gmail.com";
            // - smtp.gmail.com use smtp authentication
            mailMsg.Fields.Add
            ("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate";, "1");
            mailMsg.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendusername";, "
[EMAIL PROTECTED]");
            mailMsg.Fields.Add("
http://schemas.microsoft.com/cdo/configuration/sendpassword";,
            "xxxx");
            // - smtp.gmail.com use port 465 or 587
            mailMsg.Fields.Add
            ("http://schemas.microsoft.com/cdo/configuration/smtpserverport";,
"465");
            // - smtp.gmail.com use STARTTLS (some call this SSL)
            mailMsg.Fields.Add
            ("http://schemas.microsoft.com/cdo/configuration/smtpusessl";,
"true");
            // try to send Mail
            try
            {
                SmtpMail.Send(mailMsg);
                return "";
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
        }

Some example using google mail (or any smtp server) with mono??

Thanks,
Rolando



From: "Chris Howie" <[EMAIL PROTECTED]>
Subject: Re: [Mono-list] send a mail using mono
To: "Mono mailing list" <[email protected]>
Message-ID:
       <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=UTF-8

On Tue, Sep 9, 2008 at 9:03 PM, Christian L?pez Esp?nola
<[EMAIL PROTECTED]> wrote:
> Does a telnet to smtp.uach.cl:465? Do this work with MS.net? Are
> gmail.com users valid for this SMTP server?

Also, port 465 is typically used for TLS-encrypted SMTP.  I believe
the framework supports SSL (if you set the appropriate property) but I
don't think it supports TLS.

--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to