I am using the following code in .net 2:
MailAddress fromAddress = new MailAddress("va lid_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.IsBodyH tml = true;
SmtpClient smtp = new SmtpClient("val id_smtp_srv");
smtp.Credential s = new System.Net.Netw orkCredential
("valid_smtp_ad dr", "valid_pwd" );
smtp.Send(messa ge);
---
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 3 2836
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:50 4 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("va lid_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.IsBodyH tml = true; SmtpClient smtp = new SmtpClient("val id_smtp_srv");
smtp.Credential s = new System.Net.Netw orkCredential ("valid_smtp_ad dr", "valid_pwd" ); smtp.Send(messa ge);
---
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
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******** *************** ***********@mic rosoft.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:50 4 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("va lid_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.IsBodyH tml = true; SmtpClient smtp = new SmtpClient("val id_smtp_srv");
smtp.Credential s = new System.Net.Netw orkCredential ("valid_smtp_ad dr", "valid_pwd" ); smtp.Send(messa ge);
---
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
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******** *************** ***********@mic rosoft.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:50 4 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("va lid_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.IsBodyH tml = true; SmtpClient smtp = new SmtpClient("val id_smtp_srv");
smtp.Credential s = new System.Net.Netw orkCredential ("valid_smtp_ad dr", "valid_pwd" ); smtp.Send(messa ge);
---
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 client closes the connection, it should do so too.
It's going to "relay" PCL and/or PostScript printjobs to a TCP/IP printer.
Does anyone have some sugggestions on code-examples? I've tried googling
around, but couldn'r find anythin usefull.
|
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 zip file.
I'm doing this using wshShell.Exec, the WinZip command line tool and
zip2exe.exe from the pkware suite (because WinZip's command line
doesn't support creating self-extracting archives and for historical
compatibility reasons). This is...
|
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;
message.To.Add(new MailAddress("someaddress@yahoo.com"));
message.Body = Body;
message.Subject = Subject;
message.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("valid_smtp_srv");
|
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
coming from:
sem_trywait: Permission denied
sem_wait: Permission denied
sem_post: Permission denied
|
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 Roles etc, but I'm clueless ;)
| |
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 had to manually install
all of the ODBC drivers and the rest of the DLL's, and now I am getting
"Access is Denied" errors on any page that uses ADODB.
How do I fix it? I already gave the ODBC drivers in the folders in
"c:\program files\common...
|
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 original question, the
subject line is:
ADODB.NET and "Access Denied"
I have an ASP.NET page writtein in VB that uses ADODB. I just had to
|
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. Aside from having administrative
rights, I have also put myself in the Debugger Users group. I have added
ASPNET and even IUSR_SERVERNAME to the Debuggers group (don't worry, it's a
dev server not a live machine) and I still get "Access Denied"...
|
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 As String
bodyMSG = "something"
smtp.Send("something@thetotalsite.it",
someone@gmail.com, "Message from thetotalsite", bodyMSG)
|
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 don't get this error when viewing the page directely in IE.
Thank you
Noro
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |