Home All Groups Group Topic Archive Search About
Author
20 Oct 2005 1:46 PM
barry
Hi

    I a developing on a Windows 2003 Server environment with MS Exchange
2003 installed, using the following code i am able to send e-mail message to
Administra***@myserver.com but not to any internet address eg
ba***@gmail.com


    try
    {
       MailMessage Message = new MailMessage();
       Message.To = "ba***@gmail.com";
       Message.From = "administra***@myserver.com";
       Message.Subject = "Testing";
       Message.Body = "Some message";

       try
       {
           SmtpMail.SmtpServer = "MYSERVER";
           SmtpMail.Send(Message);
       }
       catch(System.Web.HttpException ehttp)
       {
       }


TIA
Barry

Author
20 Oct 2005 2:10 PM
Lars Behrmann
Hi Barry,

maybe the problem is, that this example
works without authentication ? I think you
should use a smtp implementation which support
authentication. On Codeproject.com you
will find a smtp mailer class with authentication
and attachement support ;) Also you should
install a trace programm like YATT to trace
the communication between your app and the
smtp server.

http://www.codeproject.com/csharp/smtpemailer.asp

Cheers
Lars Behrmann

_________________
Nothing is impossible. UML is the key for all your problems.
AODL - Make your .net apps OpenOffice ready
http://aodl.sourceforge.net/

barry schrieb:

Show quote
> Hi
>
>     I a developing on a Windows 2003 Server environment with MS Exchange
> 2003 installed, using the following code i am able to send e-mail message to
> Administra***@myserver.com but not to any internet address eg
> ba***@gmail.com
>
>
>     try
>     {
>        MailMessage Message = new MailMessage();
>        Message.To = "ba***@gmail.com";
>        Message.From = "administra***@myserver.com";
>        Message.Subject = "Testing";
>        Message.Body = "Some message";
>
>        try
>        {
>            SmtpMail.SmtpServer = "MYSERVER";
>            SmtpMail.Send(Message);
>        }
>        catch(System.Web.HttpException ehttp)
>        {
>        }
>
>
> TIA
> Barry

AddThis Social Bookmark Button