Re: Using System.Net.Mail

Efran Cobisi <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Organization QBGROUP SpA
Message-ID <[email protected]>
Hi Clark,

Could you assure that you set up the appropriate smtp server
informations in the right place inside your web.config file (i.e.
/configuration/system.net/mailSettings/smtp/network)?
A common error consists in leaving the original System.Web.Mail settings
inside the web.config file and forgetting to set up the ones needed by
the (not so) new System.Net.Mail.

Also check out [1] and [2], which have loads of information about both
the systems.

[1] http://www.systemwebmail.com/
[2] http://www.systemnetmail.com/

HTH,

--
Efran Cobisi
http://www.cobisi.com

Clark, Michael (OFM) wrote:
> I've tried fully qualifying the server, using the IP address, and
> setting the server info via the configuration file.  No luck; same
> errors.
>
> -----Original Message-----
> From: Discussion of building .NET applications targeted for the Web
> [mailto:[email protected]] On Behalf Of Jacob Mattison
> Sent: Friday, May 04, 2007 11:06 AM
> To: [email protected]
> Subject: Re: [DOTNET-WEB] Using System.Net.Mail
>
> That looks right to me.  In my case I have to use the fully qualified
> name of the SMTP server, so if the server is called smtp1, I have to use
> "smtp1.jwu.edu".  Perhaps that would help?
>
> Alternately, if you weren't specifying an external mail server
> previously, it may have been using a local SMTP server.  Perhaps there's
> a firewall setting on the SMTP server that's preventing a connection
> from the machine this is running on?
>
> I don't think it's a problem in your code.
>
>
>
> -----Original Message-----
>
> string to = "[email protected]";
> string from = "[email protected]";
> MailMessage message = new MailMessage(from, to); message.Subject =
> "Using the new SMTP client."; message.Body = @"Using this new feature,
> you can send an e-mail message from an application very easily.";
> SmtpClient client = new SmtpClient(Server); client.UseDefaultCredentials
> = true; client.Send(message);
>
> When the Send is executed this exception is raised:
> "An established connection was aborted by the software in your host
> machine "
>
> Looking further, the status code given is "GeneralFailure", the
> exception message is "Failure sending mail." and the inner exception
> message is "Unable to connect to the remote server".
>
> The problem may or may not be centered around the server name.  It's a
> server on our intranet, and I have tried both its name and its IP
> address, but no joy.
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>

--
Efran Cobisi
Technical Project Leader
MCP, MCTS: SQL Server 2005
[email protected] <mailto:[email protected]>



QBGROUP spa
Corso del Popolo, 8/C - 35131 Padova - Italy
tel. +39 049.8763444 - fax +39 049.8787700
www.qbgroup.it <http://www.qbgroup.it>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.