MailMessage Sent To Any Adress From Windows Forms Application, But Not From Asp.net Application, After Both Are Using The Same SMTP-server?

Jan 27, 2010

I'm experiencing a to me mysterious error when sending e-mails through a SMTP-server from an ASP.NET web application. I get the famous error "unable to relay for xxx@yyy.zzz". What's mysterious to me is that when I cut and paste the exact same code that sends the e-mail into an usual .NET Windows Forms application, send the e-mail with this application, it all works just fine. This made me think that perhaps the problem is that the ASP.NET application runs as NETWORK SERVICE while the Windows Forms application runs on a domain user account, but it turns out that I have another ASP.NET application sending e-mail through the same SMTP-server running under NETWORK SERVER at the same IIS, and this application does not experience this problem.

I've further tried to send e-mails through the SMTP-server manually by telnet the smtp-server on port 25 and running the SMTP-protocol manually, and it all works fine. The SMTP-server is not configured with any kind of authentication or SSL.

Another mysterious fact is that the ASP.NET application can send e-mails from an adress within the same domain to an e-mail adress within the same domain, but not to any adress outside of the domain. But the Windows Forms application, that uses the exact same code, can send e-mails from any adress to any adress both within AND outside of the domain.

So to summarize:

The ASP.NET application can send
e-mails from addresses within the
domain to adresses within the domain,
but not to addresses outside of the
domain.
A Windows Forms application running
the same code on the same computer
can send e-mails from ANY address to
ANY address.
Another ASP.NET application on the
same IIS running under the same
account (NETWORK SERVICE) can send
e-mails using the same SMTP-server
from ANY adress to ANY adress.
There is no authentication configured
on the SMTP-Server.
Both the ASP.NET application and the
Windows Forms application utilizes
the System.Net.Mail.SmtpClient class
to send a
System.Net.Mail.MailMessage.

The code that sends the e-mail massage is:

private void button1_Click(object sender, EventArgs e)
{
MailMessage mesasge = new MailMessage(txtFrom.Text, txtTo.Text, "Test mail", txtBody.Text);
SmtpClient client = new SmtpClient();
if (!(string.IsNullOrEmpty(txtUserName.Text))) //Is false since txtUserName.Text is empty
client.Credentials = new System.Net.NetworkCredential(txtUserName.Text, txtPassword.Text);
client.EnableSsl = false;
client.Host = txtServer.Text;
client.Port = 25;
try
{
client.Send(mesasge);
}
catch (Exception ex)
{
txtResponse.Text = ex.Message;
}
}

As far as I can understand, this should be a matter of configuration rather than coding issues.

View 2 Replies


Similar Messages:

Web Forms :: Getting Error While Send Emails Using SMTP MailMessage

Jul 6, 2010

i am trying to send emails using SMTP MailMessage but i have a problems, i got the following error: Failed to send to pm@[URL] (530 5.7.0 Must issue a STARTTLS command first. g31sm24378313ibh.22 ) my code is the following:

[Code]....

i am using google apps for my webmail.

View 1 Replies

Migrate Application Running In Windows 2000 Server To Windows Server 2008?

Mar 10, 2010

Currently we are running an application build in VB6,ASP,Commerce Server2000 and Sql Server 2000. This application is running in Windows 2000 server.Now we are planning to migrate Windows server 2000 to Windows 2008.Will this application run in Windows 2008 or do we need to upgrade this application to dotnet and Sql 2008?

View 1 Replies

Web Forms :: Sending Email To The Users Using Smtp Client And MailMessage Class?

Apr 16, 2010

am sending email to the users using smtp client and MailMessage class.i have been adding the addresses of multiple receivers in the to property of the object of MailMessage class. the problem is that the receiver can see the email addresses of other receipents. is there any way to hide the email addresses of other receipents.i mean setting some property or something like that.otherwise i will be left with only option to send individual email to the users.

View 4 Replies

Get Application File Path In Windows Forms Application?

Nov 3, 2010

I have a simple windows form app that I need to get the file path for. I am placing a config file in the same directory and I need to be able to get the path to that file.

I have used
Application.CommonAppDataPath
but that returns the path with 1.0.0.0 at the end.

and
Applicaiton.StartupPath
but that returns the path with indebug at the end

Is there anyway to get the path to just the main file directory without anything appended to the end?

View 3 Replies

Web Forms :: Same Codes From Windows Application But Can't Compile The Same Way In Web Application

Jan 25, 2011

why is it that the exact same codes that i use to create a Windows application, which is able to work, does not work on a Web application? i created a windows application using c# and socket programming language. i will be connected to a remote server and through the windows application, and i will be able to send the "byte[] msg" to the server and activate the LED lightbulbs attached to the remote server. that exact same codes works well on the Windows application. however, when i create another Web application using the same exact codes, i does not have any error yet i am not able to activate the LED lightbulbs attached to it. is it that through the web or internet explorer i am not able to send the "byte[] msg" correctly? or that i sld modify "byte[] msg" to suit the web usage? or any other reasons?

View 7 Replies

Web Forms :: Reading Server Response In Windows Application

Nov 1, 2010

I've got a scenario to work with. In that I've to develop a windows application. On that application when the user enters some data it should be passed to a web application(Third party) and I need to get the response from that web application or web page. The responses will be just APPROVED or DECLINED. But I've no idea how to do with this. Expecting your valuable reply. I'm developing application in .NET 4.0. Plz reply me ASAP.

View 5 Replies

Web Forms :: Integrate Windows Application Into Web Application?

May 19, 2012

is it possible to call or integrate the windows application into asp.net web application? is it yes then tell me how to do it.

View 1 Replies

Can Windows Service Application Share A Bin Folder With A Web Application

Jan 5, 2011

I have some common dlls that are referenced by both a windows service application and a asp.net web application. I don't want to make separate copies of the dlls and I also don't want to put those dlls into GAC. I try to put that service application under the same root folder as the web application so that they can share the same bin folder. I am not quite sure if this will cause any problems? I did find the web application had random session timeout, but not very often. Not sure if it was caused by the shared dlls.

View 1 Replies

Write A Application Which Connects To Remote Server(windows 2003 Server

Jan 17, 2011

I have to write a application which connects to remote server(windows 2003 server, open SQL Management studio in that server and enter a specific SQL Server address and access a stored procedure, change some values and execute the stored procedure.)

I have to write this application using C#.Net , Could anybody point me in right direction, Where do I start?

View 6 Replies

Setting Up Web Application Under IIS 7 On Windows Server 2008 Box

Feb 16, 2010

I've developed my .net web application in Visual Studio 2005. It's been running in production on a hosted server. We recently brought in-house our own servers and configured one as a web server. I am trying to set up my web application over there and am getting your typical errors like the resource cannot be found. If you could point me to a good link, that would be great, too. I know I am having very elementary problems like creating the correct virtual directory, etc.

View 9 Replies

Iis - Trying To Get An Application Up On IIS On A Windows Server 2008 Machine?

Feb 11, 2011

I'm trying to get an asp.net application up on IIS on a Windows Server 2008 machine. I can hit the app from localhost, no problem. But I can't access the app using the server's domain name either locally or from another machine on the network.But here's the odd part. I can access a normal file on IIS using the domain name, both from a browser running on the server and from a browser running on another machine on the network. Here's a synopsis ("http" converted to "htp" below because I don't have enough points to have all these links in my message):

From IE on the server itself:
works htp://localhost/foo.htm
works htp://localhost/App
works htp://test.foo.com/foo.htm
dead htp://test.foo.com/App
From IE on another machine:
works htp://test.foo.com/foo.htm
dead htp://test.foo.com/App

View 3 Replies

Passing Data From Windows Application To Web Application?

Apr 26, 2010

I have a windows application and a web application. The windows as well as web application has a login page. The username and password are same for the windows and web application.

In the windows application, the user enters the username and password. With this username and password in windows application, is it possible to log into the web application? If yes, How to pass the data from windows application to web application, thereby logging into the web application. Is it possible to pass the username and password from a windows application to a web application?

View 5 Replies

Converting Windows Form Application In Web Application?

Dec 27, 2010

Is it possible to convert a windows form application into a web application?

If it is not possible, how can I add the OpenFileDialog in a web application form?

I cannot see it in the toolbox if i choose new web application. On the other hand, I can see it if I choose windows form application.

View 21 Replies

WCF / ASMX :: Passing Value From Web Application To Windows Application?

Aug 17, 2010

I have a web page where I used a gridview and a button.When selecting rows in the grid and click on the button another windows application fires.I need to pass the values of the selected rows to the windows application.

Rightnow I'm saving the values in an xml file and fetch the values in the windows application.But this is not practical when creating xml files with random numbers(Scan125.xml,Scan7867.xml,etc).

View 1 Replies

Local Web Application Or Windows Application For System?

Jun 17, 2010

I am going to design system that will keep track of publications due by researchers in my work place
Need for this project :

1- a database housing the information .

2- Automatic reports must be generated .

the users will upload PDF and we have around 25 researchers.

I can't decide which one is better for my system .

My questions are :

1- Local web application or windows application ?

2- Access or SQL as database ?

3- I have visual studio 2010 for student use, Could I use it or I need to buy one ?

View 1 Replies

Web Application References For A C# Windows Application Developer?

Oct 14, 2010

I am used to working on C# .NET windows applications. I am interested in starting with web applications. good ebooks or references for C# ASP.net to begin with for a guy like me who is comfortable with windows applications?

View 3 Replies

Getting Error When Deploying On Application On Windows Server 2003

Aug 17, 2010

I am getting the error -- Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action WEBCA_FillComboBox, entry: FillComboBox, library: C:DOCUME~1ADMINI~1.XYZLOCALS~1TempMSI15B.tmp -- when I try to deploy a ASP.NET application on the server.I am using "Enablehostheaders.js" to select the website where I need to install the files..I am using visual studio.net 2003/framework 1.1

It is working fine in the development system..

View 4 Replies

Configuration :: Deploying Web Application To Windows Server 2003

Oct 31, 2010

I have built my site using VS.Net 2010 on my XP machine. I would like to deploy it to my server which is a Windows 2003 Server. I have tried to do it with FTP, but it keeps failing with the error that "Front Page Extensions are not installed on the web server". When I check the server the extensions were installed and I also checked IIS and the service for the extension is allowed.

View 6 Replies

Security :: Publishing Application On Windows Server 2008 And IIS 7

Dec 12, 2010

i published an application on windows server 2008 and IIS 7 i am facing a problem when user are trying to access the server or the web application in address they put ip address of the server /application a pop up screen asking for username and password problem IIS on windows server 2008 ..the server is configured it s making me crazy it s asking users for username and password

View 3 Replies

Application Accessing Event Log On Windows Server 2008 R2?

Feb 21, 2011

Can anyone explain why the following happens:My ASP.NET application requires access to Application event log.When I access web application initially, it returns "Security" exception (which is expected, as I haven't granted permissions to write to Application event log yet). Then I give read/write permissions to IIS_IUSRS group on the following registry key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetserviceseventlog. As a result of this action my web application starts working.Now I remove those permissions I've granted to IIS_IUSRS group. But my web application keeps working (although I'd expect "Security" exception raised again)So, why web application keeps working, although permissions to write to Application loghave been removed?

View 2 Replies

SMTP Authentication On IIS 7 Windows Server 2008 R2 64 Bit?

Aug 9, 2010

I have IIS 7 windows server 2008 R2 64 bit on which I have few web sites which are sending emails thorugh asp.net. Each web site has seperate "From Address (used inside the code)".

In IIS 6.0 mananger >> Delivery Tab >> Out bound security >>I gave Integrated windows authentication for one account (Let us say abc).

When the emails are firing from different applications, the emails are going only if the from address is abc mentioned in the authentication. If any other email address is used then it is going to bad mail folder saying "Diagnostic-Code: smtp;550 5.7.1 Client
does not have permissions to send as this sender".So to make it work I have changed the authentication to anonymous then again the emails are going to bad mail with "Diagnostic-Code: smtp;530 5.7.1 Client was not authenticated" error.

View 1 Replies

Configuration :: How To Deploy Application To Totally New Windows 2003 Server

Mar 8, 2010

Can someone point me to a step-by-step guide on how to deploy ASP.Net applications to a totally empty and brand new Windows 2003 Server?The server has ASP.Net and the .Net framework installed on it. IIS is up and running. I have created a new application pool.

View 2 Replies

Installation :: Running A Web Application In Vs-2008 On Windows 2003 Server?

Jun 3, 2010

I am running a web application in vs-2008 on windows 2003 server.While execution of .net application, I am getting an error as"Unable to start debugging on the web server. Unable to connect to the web server. Verify that web server is running and that incoming HTTP requests are not blocked by firewall."

View 5 Replies

Execute Powershell Commands On Windows 2008 Server From Application?

Nov 26, 2010

I want to execute some powershell commands on a remote windows 2008 machine. Right now i am using psexec to run the powershell from c# asp.net application. I would like to know is there any way to execute powershell commands without using a third party tool like psexec?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved