SMTP sending e-mail

J

John J. Hughes II

I have an application that sends simple e-mails using SMTP, it no longer
works with a lot of e-mail servers.

Basically the problem seems to be that I am no longer sending a valid logon
sequence. The server says the user is not authorized, if I switch to
Outlook it works.

Code to send authorizion.

this.SendData("AUTH LOGIN" + CRLF);
string user =
Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(this.User));
this.SendData(user + CRLF);
string pw =
Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(this.Password));
result = this.SendData(pw + CRLF);
if(result.StartsWith("235"))
break;

This is what outlook is doing per the log file:

[tx] AUTH NTLM
<rx> 334 NTLM supported
[tx] TlRM.....


Any one know how to send NTLM type logon or another methed to work around
this problem?

Regards,
John
 
J

John J. Hughes II

Patrice,

Thanks for the lead...

I would perfer to use the System.Web.Mail and that is what I used in the
first place. I recall running into a problem if IIS was not installed since
it use that or something.

Oh well I have tried again and am getting this error, any suggestion?

Error:Could not access 'CDO.Message' object.
Inner:Exception has been thrown by the target of an invocation.
Stack: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
String methodName, Object[] args)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at RAMSComThrd.sendAlarm..ctor(String ac, String num, String data) in
c:\documents and settings\all users\documents\shared
vsp\work\ramscomthrd\sendalarm.cs:line 70
at MailTest.Form1.btnTest_Click(Object sender, EventArgs e) in
c:\documents and settings\john @ work\my documents\visual studio
projects\mailtest\form1.cs:line 494

Regards,
John
 
P

Patrice

Yes, you need to install the SMTP service first (IMO this service doesn't
require IIS itself).

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top