473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

"Relay Denied" but no match for outlook!

dp
I am using the following code in .net 2:

MailAddress fromAddress = new MailAddress("valid_smtp_addr", "name");
MailMessage message = new MailMessage();
message.From = fromAddress;
message.To.Add(new MailAddress("so*********@yahoo.com"));
message.Body = Body;
message.Subject = Subject;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("valid_smtp_srv");

smtp.Credentials = new System.Net.NetworkCredential
("valid_smtp_addr", "valid_pwd");
smtp.Send(message);

---

No errors (with the authentication to the smtp server etc etc) but still all
I get is the "Relay Denied" response.
Outlook express does manage to send the same email through the same smtp
server using the same settings, though !

How is this possible ? What's the difference between outlook and my code ?

thanx
Nov 22 '05 #1
3 2822
dp
TIP:
According to the server log the outlook succeeds in authentication but the
c# code sends the wrong command and the smtp always responds with message
"SMTPS:S:504 Mechanism not supported".

Maybe this is a lead ?
How the authentication method can be configured in code ?

still, anyone on the original question ?
"dp" wrote:
I am using the following code in .net 2:

MailAddress fromAddress = new MailAddress("valid_smtp_addr", "name");
MailMessage message = new MailMessage();
message.From = fromAddress;
message.To.Add(new MailAddress("so*********@yahoo.com"));
message.Body = Body;
message.Subject = Subject;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("valid_smtp_srv");

smtp.Credentials = new System.Net.NetworkCredential
("valid_smtp_addr", "valid_pwd");
smtp.Send(message);

---

No errors (with the authentication to the smtp server etc etc) but still all
I get is the "Relay Denied" response.
Outlook express does manage to send the same email through the same smtp
server using the same settings, though !

How is this possible ? What's the difference between outlook and my code ?

thanx

Nov 22 '05 #2
hmm, really not sure if this is the right answer, but Outlook has a
mechanism to prevent sending mails through other applicatíons. However,
there is a registry switch to change this behaviour.

HTH

Andy

"dp" <dp@discussions.microsoft.com> schrieb im Newsbeitrag
news:AD**********************************@microsof t.com...
TIP:
According to the server log the outlook succeeds in authentication but the
c# code sends the wrong command and the smtp always responds with message
"SMTPS:S:504 Mechanism not supported".

Maybe this is a lead ?
How the authentication method can be configured in code ?

still, anyone on the original question ?
"dp" wrote:
I am using the following code in .net 2:

MailAddress fromAddress = new MailAddress("valid_smtp_addr", "name");
MailMessage message = new MailMessage();
message.From = fromAddress;
message.To.Add(new MailAddress("so*********@yahoo.com"));
message.Body = Body;
message.Subject = Subject;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("valid_smtp_srv");

smtp.Credentials = new System.Net.NetworkCredential
("valid_smtp_addr", "valid_pwd");
smtp.Send(message);

---

No errors (with the authentication to the smtp server etc etc) but still
all
I get is the "Relay Denied" response.
Outlook express does manage to send the same email through the same smtp
server using the same settings, though !

How is this possible ? What's the difference between outlook and my code
?

thanx

Nov 22 '05 #3
dp
I strongly suspect authentication is not supported by
System.Net.Mail.SmtpClient at all.
The c# source code found at:
http://www.codeproject.com/csharp/EmailMessage.asp
does the whole smtp protocol communication manually and it works !
(btw, many many thanx to Peter Wone for his _working_ code)

I've tried it with all the same settings as in my original code and relay is
no longer an issue (since I am authenticated of course).

I still can't believe SmtpClient fails to send the AUTH LOGIN smtp command
properly. Anyone got any ideas ?

thanx

"Andreas Schubert" wrote:
hmm, really not sure if this is the right answer, but Outlook has a
mechanism to prevent sending mails through other applicatÃ*ons. However,
there is a registry switch to change this behaviour.

HTH

Andy

"dp" <dp@discussions.microsoft.com> schrieb im Newsbeitrag
news:AD**********************************@microsof t.com...
TIP:
According to the server log the outlook succeeds in authentication but the
c# code sends the wrong command and the smtp always responds with message
"SMTPS:S:504 Mechanism not supported".

Maybe this is a lead ?
How the authentication method can be configured in code ?

still, anyone on the original question ?
"dp" wrote:
I am using the following code in .net 2:

MailAddress fromAddress = new MailAddress("valid_smtp_addr", "name");
MailMessage message = new MailMessage();
message.From = fromAddress;
message.To.Add(new MailAddress("so*********@yahoo.com"));
message.Body = Body;
message.Subject = Subject;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("valid_smtp_srv");

smtp.Credentials = new System.Net.NetworkCredential
("valid_smtp_addr", "valid_pwd");
smtp.Send(message);

---

No errors (with the authentication to the smtp server etc etc) but still
all
I get is the "Relay Denied" response.
Outlook express does manage to send the same email through the same smtp
server using the same settings, though !

How is this possible ? What's the difference between outlook and my code
?

thanx


Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tomas Christiansen | last post by:
Im trying to make a simple TCP socket "relay" or "proxy", but my skills in Python are not high (yet). The only thing it should do, is to open the connection on behalf of the client, and when the...
7
by: Mark DuPrey | last post by:
I've got a script in an ASP page that is supposed to extract certain files from a zip file, move them, create a new zip with the moved files and then make a self-extracting archive out of the new...
3
by: dp | last post by:
I am using the following code in .net 2: MailAddress fromAddress = new MailAddress("valid_smtp_addr", "name"); MailMessage message = new MailMessage(); message.From = fromAddress;...
1
by: Mark E. Hamilton | last post by:
Sorry, I probably should have re-stated the problem: We're using Python 2.3.5 on AIX 5.2, and get the follow error messages from some of our code. I haven't yet tracked down exactly where it's...
0
by: Oliver | last post by:
hi - I have a written a "Serviced Component" which works fine when declared as: but I am seeing an 'Access Denied' exception when I declare it as: this is probably something to do with...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
0
by: Rico | last post by:
Helolo, I have an ASP.NET application on a Windows 2003 Server machine WITHOUT VS. I am working on an XPPro machine with VS 2003. I have installed the remote debugging components on the server....
5
by: Carmine [www.thetotalsite.it] | last post by:
Hi everyone, I get a really odd error while using SMTPClient.Send() function in ASP.Net. The error is the following: Dim smtp As New Net.Mail.SmtpClient("smtp.thetotalsite.it", 25) Dim bodyMSG...
3
by: noureddine | last post by:
When I create a folder in outlook and give it a homepage url to an ajax asp.net page I've developed, I get ajax errors on my page when viewed in outlook. The Error is : "Access is denied". I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.