![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | SMTPClient Authentication problems I am having problems Authenticating to my SMTP Server. The code I am using is as follows public void SendMail(string fromAddress, string toAddress, string subject, string body, string Password) { try { MailMessage msg = new MailMessage(); msg.From = new MailAddress(fromAddress); msg.To.Add(new MailAddress(toAddress)); msg.Subject = subject; msg.Body = body; msg.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "myemailserver.net"; smtp.Port = 25; smtp.UseDefaultCredentials = false; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Credentials = new System.Net.NetworkCredential("testaccount", "design"); smtp.EnableSsl = false; smtp.Send(msg); //return true; } catch (Exception ex) { ///Log.Write(ex) //return false; } } when I view the log on the smtp server I get [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com AAMail SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH LOGIN [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN aWRzbWVkaWEubmV0XGRlc2lnbg== [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 [12-09 11:08:23] 98.172.47.252: SMTP_client: design [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 [12-09 11:08:23] 98.172.47.252: SMTP_client: [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed I am far from an expert on SMTP but it appears that it is only sending over the paasword and not the login information. but if I new that for sure I woulnt be here asking. any help would be apprecitated I am using VS2008, .net 2.0/3.5, silverlight 2 thanks |
My System Specs![]() |
| | #2 (permalink) |
| | Re: SMTPClient Authentication problems This should help you. http://sholliday.spaces.live.com/Blo...842A!138.entry You can download the code and reuse the library ... OR you can at least tweak until you figure out which parameters you need to set. I would reuse the small library. "Glenn" <Glenn@xxxxxx> wrote in message news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx Quote: >I am having problems Authenticating to my SMTP Server. The code I am using >is > as follows > > public void SendMail(string fromAddress, string toAddress, string subject, > string body, string Password) > { > try > { > MailMessage msg = new MailMessage(); > msg.From = new MailAddress(fromAddress); > msg.To.Add(new MailAddress(toAddress)); > msg.Subject = subject; > msg.Body = body; > msg.IsBodyHtml = false; > SmtpClient smtp = new SmtpClient(); > smtp.Host = "myemailserver.net"; > smtp.Port = 25; > > smtp.UseDefaultCredentials = false; > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; > smtp.Credentials = new > System.Net.NetworkCredential("testaccount", "design"); > smtp.EnableSsl = false; > smtp.Send(msg); > //return true; > } > catch (Exception ex) > { > ///Log.Write(ex) > //return false; > > > } > } > > when I view the log on the smtp server I get > > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com > AAMail > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH > LOGIN > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN > aWRzbWVkaWEubmV0XGRlc2lnbg== > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 > [12-09 11:08:23] 98.172.47.252: SMTP_client: design > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 > [12-09 11:08:23] 98.172.47.252: SMTP_client: > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed > > I am far from an expert on SMTP but it appears that it is only sending > over > the paasword and not the login information. but if I new that for sure I > woulnt be here asking. any help would be apprecitated > > I am using VS2008, .net 2.0/3.5, silverlight 2 > thanks |
My System Specs![]() |
| | #3 (permalink) |
| | Re: SMTPClient Authentication problems I lookat at the code it used I am using all the exact settings it is for the message and smtp client settings for basic authentication. "sloan" wrote: Quote: > This should help you. > > http://sholliday.spaces.live.com/Blo...842A!138.entry > > You can download the code and reuse the library ... OR you can at least > tweak until you figure out which parameters you need to set. > > I would reuse the small library. > > > "Glenn" <Glenn@xxxxxx> wrote in message > news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx Quote: > >I am having problems Authenticating to my SMTP Server. The code I am using > >is > > as follows > > > > public void SendMail(string fromAddress, string toAddress, string subject, > > string body, string Password) > > { > > try > > { > > MailMessage msg = new MailMessage(); > > msg.From = new MailAddress(fromAddress); > > msg.To.Add(new MailAddress(toAddress)); > > msg.Subject = subject; > > msg.Body = body; > > msg.IsBodyHtml = false; > > SmtpClient smtp = new SmtpClient(); > > smtp.Host = "myemailserver.net"; > > smtp.Port = 25; > > > > smtp.UseDefaultCredentials = false; > > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; > > smtp.Credentials = new > > System.Net.NetworkCredential("testaccount", "design"); > > smtp.EnableSsl = false; > > smtp.Send(msg); > > //return true; > > } > > catch (Exception ex) > > { > > ///Log.Write(ex) > > //return false; > > > > > > } > > } > > > > when I view the log on the smtp server I get > > > > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT > > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com > > AAMail > > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. > > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt > > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH > > LOGIN > > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN > > aWRzbWVkaWEubmV0XGRlc2lnbg== > > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 > > [12-09 11:08:23] 98.172.47.252: SMTP_client: design > > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 > > [12-09 11:08:23] 98.172.47.252: SMTP_client: > > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed > > > > I am far from an expert on SMTP but it appears that it is only sending > > over > > the paasword and not the login information. but if I new that for sure I > > woulnt be here asking. any help would be apprecitated > > > > I am using VS2008, .net 2.0/3.5, silverlight 2 > > thanks > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: SMTPClient Authentication problems Did you try to run my code and see if it failed? I'm guessing, but maybe chronological order of the MailMessage and SmtpClient makes a difference (<<I wouldn't think it would, but it might....I've seen weird stuff) ? Or maybe the constructor I'm using or MailMessage? See if my example works, and then if it doesn't, then post the results. Are you sure about the port? ........ I have my used my example in 6 different environments (home/work/staging/production/hosted sites, etc), one of the reasons I trust it. What is great about my library, is that with a few tweaks of the config file, you can experiment with NONE/BASIC/SSL. Try the others ones. Try to get my code up and running. I'm not trying to be argumentative, I'm just trying to help you. "Glenn" <Glenn@xxxxxx> wrote in message news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx Quote: >I lookat at the code it used I am using all the exact settings it is for >the > message and smtp client settings for basic authentication. > > "sloan" wrote: > Quote: >> This should help you. >> >> http://sholliday.spaces.live.com/Blo...842A!138.entry >> >> You can download the code and reuse the library ... OR you can at least >> tweak until you figure out which parameters you need to set. >> >> I would reuse the small library. >> >> >> "Glenn" <Glenn@xxxxxx> wrote in message >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx Quote: >> >I am having problems Authenticating to my SMTP Server. The code I am >> >using >> >is >> > as follows >> > >> > public void SendMail(string fromAddress, string toAddress, string >> > subject, >> > string body, string Password) >> > { >> > try >> > { >> > MailMessage msg = new MailMessage(); >> > msg.From = new MailAddress(fromAddress); >> > msg.To.Add(new MailAddress(toAddress)); >> > msg.Subject = subject; >> > msg.Body = body; >> > msg.IsBodyHtml = false; >> > SmtpClient smtp = new SmtpClient(); >> > smtp.Host = "myemailserver.net"; >> > smtp.Port = 25; >> > >> > smtp.UseDefaultCredentials = false; >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; >> > smtp.Credentials = new >> > System.Net.NetworkCredential("testaccount", "design"); >> > smtp.EnableSsl = false; >> > smtp.Send(msg); >> > //return true; >> > } >> > catch (Exception ex) >> > { >> > ///Log.Write(ex) >> > //return false; >> > >> > >> > } >> > } >> > >> > when I view the log on the smtp server I get >> > >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com >> > AAMail >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 AUTH >> > LOGIN >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN >> > aWRzbWVkaWEubmV0XGRlc2lnbg== >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication failed >> > >> > I am far from an expert on SMTP but it appears that it is only sending >> > over >> > the paasword and not the login information. but if I new that for sure >> > I >> > woulnt be here asking. any help would be apprecitated >> > >> > I am using VS2008, .net 2.0/3.5, silverlight 2 >> > thanks >> >> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: SMTPClient Authentication problems Then I don't know. Did you wire up SSL just to make sure? Is your Outlook setup for Exchange Server or SMTP? .......... My only leftover advice is to delete (or create a new) profile in Outlook, and work through (re setup) the smtp setup settings to make sure you're not missing something. "Glenn" <Glenn@xxxxxx> wrote in message news:9EB10732-577D-4632-B011-C3EB17B20B58@xxxxxx Quote: > it failed against my smtp server same error message. SMTP_server: 535 > authentication failed. I know the code I have can work. I tried it againt > a > cox.net server and it sent the email. when I tried it against the other > smtp > server it failed. but I know the smtp server is working I can do a test > send > and recive from outlook 2007. and it comes back fine. > > "sloan" wrote: > Quote: >> Did you try to run my code and see if it failed? >> >> I'm guessing, but maybe chronological order of the MailMessage and >> SmtpClient makes a difference (<<I wouldn't think it would, but it >> might....I've seen weird stuff) >> ? >> Or maybe the constructor I'm using or MailMessage? >> >> See if my example works, and then if it doesn't, then post the results. >> >> Are you sure about the port? >> ........ >> >> I have my used my example in 6 different environments >> (home/work/staging/production/hosted sites, etc), one of the reasons I >> trust >> it. >> >> What is great about my library, is that with a few tweaks of the config >> file, you can experiment with NONE/BASIC/SSL. >> Try the others ones. >> Try to get my code up and running. >> >> I'm not trying to be argumentative, I'm just trying to help you. >> >> >> >> >> >> >> >> >> "Glenn" <Glenn@xxxxxx> wrote in message >> news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx Quote: >> >I lookat at the code it used I am using all the exact settings it is for >> >the >> > message and smtp client settings for basic authentication. >> > >> > "sloan" wrote: >> > >> >> This should help you. >> >> >> >> http://sholliday.spaces.live.com/Blo...842A!138.entry >> >> >> >> You can download the code and reuse the library ... OR you can at >> >> least >> >> tweak until you figure out which parameters you need to set. >> >> >> >> I would reuse the small library. >> >> >> >> >> >> "Glenn" <Glenn@xxxxxx> wrote in message >> >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx >> >> >I am having problems Authenticating to my SMTP Server. The code I am >> >> >using >> >> >is >> >> > as follows >> >> > >> >> > public void SendMail(string fromAddress, string toAddress, string >> >> > subject, >> >> > string body, string Password) >> >> > { >> >> > try >> >> > { >> >> > MailMessage msg = new MailMessage(); >> >> > msg.From = new MailAddress(fromAddress); >> >> > msg.To.Add(new MailAddress(toAddress)); >> >> > msg.Subject = subject; >> >> > msg.Body = body; >> >> > msg.IsBodyHtml = false; >> >> > SmtpClient smtp = new SmtpClient(); >> >> > smtp.Host = "myemailserver.net"; >> >> > smtp.Port = 25; >> >> > >> >> > smtp.UseDefaultCredentials = false; >> >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; >> >> > smtp.Credentials = new >> >> > System.Net.NetworkCredential("testaccount", "design"); >> >> > smtp.EnableSsl = false; >> >> > smtp.Send(msg); >> >> > //return true; >> >> > } >> >> > catch (Exception ex) >> >> > { >> >> > ///Log.Write(ex) >> >> > //return false; >> >> > >> >> > >> >> > } >> >> > } >> >> > >> >> > when I view the log on the smtp server I get >> >> > >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 netresolutions.com >> >> > AAMail >> >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 >> >> > AUTH >> >> > LOGIN >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN >> >> > aWRzbWVkaWEubmV0XGRlc2lnbg== >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: >> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication >> >> > failed >> >> > >> >> > I am far from an expert on SMTP but it appears that it is only >> >> > sending >> >> > over >> >> > the paasword and not the login information. but if I new that for >> >> > sure >> >> > I >> >> > woulnt be here asking. any help would be apprecitated >> >> > >> >> > I am using VS2008, .net 2.0/3.5, silverlight 2 >> >> > thanks >> >> >> >> >> >> >> >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: SMTPClient Authentication problems I would redo the Outlook setup just to verify your username/password are correct. I don't think its a DotNet issue, I think its a simple issue like the wrong port or wrong userName/password combination. "sloan" <sloan@xxxxxx> wrote in message news:u5WgjkkWJHA.1328@xxxxxx Quote: > Then I don't know. > > Did you wire up SSL just to make sure? > > Is your Outlook setup for Exchange Server or SMTP? > > ......... > > My only leftover advice is to delete (or create a new) profile in Outlook, > and work through (re setup) the smtp setup settings to make sure you're > not missing something. > > > > > > > "Glenn" <Glenn@xxxxxx> wrote in message > news:9EB10732-577D-4632-B011-C3EB17B20B58@xxxxxx Quote: >> it failed against my smtp server same error message. SMTP_server: 535 >> authentication failed. I know the code I have can work. I tried it >> againt a >> cox.net server and it sent the email. when I tried it against the other >> smtp >> server it failed. but I know the smtp server is working I can do a test >> send >> and recive from outlook 2007. and it comes back fine. >> >> "sloan" wrote: >> Quote: >>> Did you try to run my code and see if it failed? >>> >>> I'm guessing, but maybe chronological order of the MailMessage and >>> SmtpClient makes a difference (<<I wouldn't think it would, but it >>> might....I've seen weird stuff) >>> ? >>> Or maybe the constructor I'm using or MailMessage? >>> >>> See if my example works, and then if it doesn't, then post the results. >>> >>> Are you sure about the port? >>> ........ >>> >>> I have my used my example in 6 different environments >>> (home/work/staging/production/hosted sites, etc), one of the reasons I >>> trust >>> it. >>> >>> What is great about my library, is that with a few tweaks of the config >>> file, you can experiment with NONE/BASIC/SSL. >>> Try the others ones. >>> Try to get my code up and running. >>> >>> I'm not trying to be argumentative, I'm just trying to help you. >>> >>> >>> >>> >>> >>> >>> >>> >>> "Glenn" <Glenn@xxxxxx> wrote in message >>> news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx >>> >I lookat at the code it used I am using all the exact settings it is >>> >for >>> >the >>> > message and smtp client settings for basic authentication. >>> > >>> > "sloan" wrote: >>> > >>> >> This should help you. >>> >> >>> >> http://sholliday.spaces.live.com/Blo...842A!138.entry >>> >> >>> >> You can download the code and reuse the library ... OR you can at >>> >> least >>> >> tweak until you figure out which parameters you need to set. >>> >> >>> >> I would reuse the small library. >>> >> >>> >> >>> >> "Glenn" <Glenn@xxxxxx> wrote in message >>> >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx >>> >> >I am having problems Authenticating to my SMTP Server. The code I am >>> >> >using >>> >> >is >>> >> > as follows >>> >> > >>> >> > public void SendMail(string fromAddress, string toAddress, string >>> >> > subject, >>> >> > string body, string Password) >>> >> > { >>> >> > try >>> >> > { >>> >> > MailMessage msg = new MailMessage(); >>> >> > msg.From = new MailAddress(fromAddress); >>> >> > msg.To.Add(new MailAddress(toAddress)); >>> >> > msg.Subject = subject; >>> >> > msg.Body = body; >>> >> > msg.IsBodyHtml = false; >>> >> > SmtpClient smtp = new SmtpClient(); >>> >> > smtp.Host = "myemailserver.net"; >>> >> > smtp.Port = 25; >>> >> > >>> >> > smtp.UseDefaultCredentials = false; >>> >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; >>> >> > smtp.Credentials = new >>> >> > System.Net.NetworkCredential("testaccount", "design"); >>> >> > smtp.EnableSsl = false; >>> >> > smtp.Send(msg); >>> >> > //return true; >>> >> > } >>> >> > catch (Exception ex) >>> >> > { >>> >> > ///Log.Write(ex) >>> >> > //return false; >>> >> > >>> >> > >>> >> > } >>> >> > } >>> >> > >>> >> > when I view the log on the smtp server I get >>> >> > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 >>> >> > netresolutions.com >>> >> > AAMail >>> >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition >>> >> > [25]/Un=39. >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 >>> >> > AUTH >>> >> > LOGIN >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN >>> >> > aWRzbWVkaWEubmV0XGRlc2lnbg== >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication >>> >> > failed >>> >> > >>> >> > I am far from an expert on SMTP but it appears that it is only >>> >> > sending >>> >> > over >>> >> > the paasword and not the login information. but if I new that for >>> >> > sure >>> >> > I >>> >> > woulnt be here asking. any help would be apprecitated >>> >> > >>> >> > I am using VS2008, .net 2.0/3.5, silverlight 2 >>> >> > thanks >>> >> >>> >> >>> >> >>> >>> >>> > |
My System Specs![]() |
| | #7 (permalink) |
| | Re: SMTPClient Authentication problems I am not using ssl and outlook works with the server why would I change the username and pass? "sloan" wrote: Quote: > I would redo the Outlook setup just to verify your username/password are > correct. > > I don't think its a DotNet issue, I think its a simple issue like the wrong > port or wrong userName/password combination. > > > > > "sloan" <sloan@xxxxxx> wrote in message > news:u5WgjkkWJHA.1328@xxxxxx Quote: > > Then I don't know. > > > > Did you wire up SSL just to make sure? > > > > Is your Outlook setup for Exchange Server or SMTP? > > > > ......... > > > > My only leftover advice is to delete (or create a new) profile in Outlook, > > and work through (re setup) the smtp setup settings to make sure you're > > not missing something. > > > > > > > > > > > > > > "Glenn" <Glenn@xxxxxx> wrote in message > > news:9EB10732-577D-4632-B011-C3EB17B20B58@xxxxxx Quote: > >> it failed against my smtp server same error message. SMTP_server: 535 > >> authentication failed. I know the code I have can work. I tried it > >> againt a > >> cox.net server and it sent the email. when I tried it against the other > >> smtp > >> server it failed. but I know the smtp server is working I can do a test > >> send > >> and recive from outlook 2007. and it comes back fine. > >> > >> "sloan" wrote: > >> > >>> Did you try to run my code and see if it failed? > >>> > >>> I'm guessing, but maybe chronological order of the MailMessage and > >>> SmtpClient makes a difference (<<I wouldn't think it would, but it > >>> might....I've seen weird stuff) > >>> ? > >>> Or maybe the constructor I'm using or MailMessage? > >>> > >>> See if my example works, and then if it doesn't, then post the results. > >>> > >>> Are you sure about the port? > >>> ........ > >>> > >>> I have my used my example in 6 different environments > >>> (home/work/staging/production/hosted sites, etc), one of the reasons I > >>> trust > >>> it. > >>> > >>> What is great about my library, is that with a few tweaks of the config > >>> file, you can experiment with NONE/BASIC/SSL. > >>> Try the others ones. > >>> Try to get my code up and running. > >>> > >>> I'm not trying to be argumentative, I'm just trying to help you. > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> "Glenn" <Glenn@xxxxxx> wrote in message > >>> news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx > >>> >I lookat at the code it used I am using all the exact settings it is > >>> >for > >>> >the > >>> > message and smtp client settings for basic authentication. > >>> > > >>> > "sloan" wrote: > >>> > > >>> >> This should help you. > >>> >> > >>> >> http://sholliday.spaces.live.com/Blo...842A!138.entry > >>> >> > >>> >> You can download the code and reuse the library ... OR you can at > >>> >> least > >>> >> tweak until you figure out which parameters you need to set. > >>> >> > >>> >> I would reuse the small library. > >>> >> > >>> >> > >>> >> "Glenn" <Glenn@xxxxxx> wrote in message > >>> >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx > >>> >> >I am having problems Authenticating to my SMTP Server. The code I am > >>> >> >using > >>> >> >is > >>> >> > as follows > >>> >> > > >>> >> > public void SendMail(string fromAddress, string toAddress, string > >>> >> > subject, > >>> >> > string body, string Password) > >>> >> > { > >>> >> > try > >>> >> > { > >>> >> > MailMessage msg = new MailMessage(); > >>> >> > msg.From = new MailAddress(fromAddress); > >>> >> > msg.To.Add(new MailAddress(toAddress)); > >>> >> > msg.Subject = subject; > >>> >> > msg.Body = body; > >>> >> > msg.IsBodyHtml = false; > >>> >> > SmtpClient smtp = new SmtpClient(); > >>> >> > smtp.Host = "myemailserver.net"; > >>> >> > smtp.Port = 25; > >>> >> > > >>> >> > smtp.UseDefaultCredentials = false; > >>> >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; > >>> >> > smtp.Credentials = new > >>> >> > System.Net.NetworkCredential("testaccount", "design"); > >>> >> > smtp.EnableSsl = false; > >>> >> > smtp.Send(msg); > >>> >> > //return true; > >>> >> > } > >>> >> > catch (Exception ex) > >>> >> > { > >>> >> > ///Log.Write(ex) > >>> >> > //return false; > >>> >> > > >>> >> > > >>> >> > } > >>> >> > } > >>> >> > > >>> >> > when I view the log on the smtp server I get > >>> >> > > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 > >>> >> > netresolutions.com > >>> >> > AAMail > >>> >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition > >>> >> > [25]/Un=39. > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 > >>> >> > AUTH > >>> >> > LOGIN > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN > >>> >> > aWRzbWVkaWEubmV0XGRlc2lnbg== > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication > >>> >> > failed > >>> >> > > >>> >> > I am far from an expert on SMTP but it appears that it is only > >>> >> > sending > >>> >> > over > >>> >> > the paasword and not the login information. but if I new that for > >>> >> > sure > >>> >> > I > >>> >> > woulnt be here asking. any help would be apprecitated > >>> >> > > >>> >> > I am using VS2008, .net 2.0/3.5, silverlight 2 > >>> >> > thanks > >>> >> > >>> >> > >>> >> > >>> > >>> > >>> > > > > |
My System Specs![]() |
| | #8 (permalink) |
| | Re: SMTPClient Authentication problems I set up a sniffer earlier and the handshake between outlook is different then the handshake with dotnet "sloan" wrote: Quote: > I would redo the Outlook setup just to verify your username/password are > correct. > > I don't think its a DotNet issue, I think its a simple issue like the wrong > port or wrong userName/password combination. > > > > > "sloan" <sloan@xxxxxx> wrote in message > news:u5WgjkkWJHA.1328@xxxxxx Quote: > > Then I don't know. > > > > Did you wire up SSL just to make sure? > > > > Is your Outlook setup for Exchange Server or SMTP? > > > > ......... > > > > My only leftover advice is to delete (or create a new) profile in Outlook, > > and work through (re setup) the smtp setup settings to make sure you're > > not missing something. > > > > > > > > > > > > > > "Glenn" <Glenn@xxxxxx> wrote in message > > news:9EB10732-577D-4632-B011-C3EB17B20B58@xxxxxx Quote: > >> it failed against my smtp server same error message. SMTP_server: 535 > >> authentication failed. I know the code I have can work. I tried it > >> againt a > >> cox.net server and it sent the email. when I tried it against the other > >> smtp > >> server it failed. but I know the smtp server is working I can do a test > >> send > >> and recive from outlook 2007. and it comes back fine. > >> > >> "sloan" wrote: > >> > >>> Did you try to run my code and see if it failed? > >>> > >>> I'm guessing, but maybe chronological order of the MailMessage and > >>> SmtpClient makes a difference (<<I wouldn't think it would, but it > >>> might....I've seen weird stuff) > >>> ? > >>> Or maybe the constructor I'm using or MailMessage? > >>> > >>> See if my example works, and then if it doesn't, then post the results. > >>> > >>> Are you sure about the port? > >>> ........ > >>> > >>> I have my used my example in 6 different environments > >>> (home/work/staging/production/hosted sites, etc), one of the reasons I > >>> trust > >>> it. > >>> > >>> What is great about my library, is that with a few tweaks of the config > >>> file, you can experiment with NONE/BASIC/SSL. > >>> Try the others ones. > >>> Try to get my code up and running. > >>> > >>> I'm not trying to be argumentative, I'm just trying to help you. > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> "Glenn" <Glenn@xxxxxx> wrote in message > >>> news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx > >>> >I lookat at the code it used I am using all the exact settings it is > >>> >for > >>> >the > >>> > message and smtp client settings for basic authentication. > >>> > > >>> > "sloan" wrote: > >>> > > >>> >> This should help you. > >>> >> > >>> >> http://sholliday.spaces.live.com/Blo...842A!138.entry > >>> >> > >>> >> You can download the code and reuse the library ... OR you can at > >>> >> least > >>> >> tweak until you figure out which parameters you need to set. > >>> >> > >>> >> I would reuse the small library. > >>> >> > >>> >> > >>> >> "Glenn" <Glenn@xxxxxx> wrote in message > >>> >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx > >>> >> >I am having problems Authenticating to my SMTP Server. The code I am > >>> >> >using > >>> >> >is > >>> >> > as follows > >>> >> > > >>> >> > public void SendMail(string fromAddress, string toAddress, string > >>> >> > subject, > >>> >> > string body, string Password) > >>> >> > { > >>> >> > try > >>> >> > { > >>> >> > MailMessage msg = new MailMessage(); > >>> >> > msg.From = new MailAddress(fromAddress); > >>> >> > msg.To.Add(new MailAddress(toAddress)); > >>> >> > msg.Subject = subject; > >>> >> > msg.Body = body; > >>> >> > msg.IsBodyHtml = false; > >>> >> > SmtpClient smtp = new SmtpClient(); > >>> >> > smtp.Host = "myemailserver.net"; > >>> >> > smtp.Port = 25; > >>> >> > > >>> >> > smtp.UseDefaultCredentials = false; > >>> >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; > >>> >> > smtp.Credentials = new > >>> >> > System.Net.NetworkCredential("testaccount", "design"); > >>> >> > smtp.EnableSsl = false; > >>> >> > smtp.Send(msg); > >>> >> > //return true; > >>> >> > } > >>> >> > catch (Exception ex) > >>> >> > { > >>> >> > ///Log.Write(ex) > >>> >> > //return false; > >>> >> > > >>> >> > > >>> >> > } > >>> >> > } > >>> >> > > >>> >> > when I view the log on the smtp server I get > >>> >> > > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 > >>> >> > netresolutions.com > >>> >> > AAMail > >>> >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition > >>> >> > [25]/Un=39. > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 > >>> >> > AUTH > >>> >> > LOGIN > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN > >>> >> > aWRzbWVkaWEubmV0XGRlc2lnbg== > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication > >>> >> > failed > >>> >> > > >>> >> > I am far from an expert on SMTP but it appears that it is only > >>> >> > sending > >>> >> > over > >>> >> > the paasword and not the login information. but if I new that for > >>> >> > sure > >>> >> > I > >>> >> > woulnt be here asking. any help would be apprecitated > >>> >> > > >>> >> > I am using VS2008, .net 2.0/3.5, silverlight 2 > >>> >> > thanks > >>> >> > >>> >> > >>> >> > >>> > >>> > >>> > > > > |
My System Specs![]() |
| | #9 (permalink) |
| | Re: SMTPClient Authentication problems this from the server log i took out the ip addresses to protect the innocent. this is outlook SMTP Response: 250-AUTH=LOGIN SMTP Command: AUTH LOGIN SMTP Response: 334 VXNlcm5hbWU6 SMTP Command: ZGVzaWduQGlkc21lZGlhLm5ldA== SMTP Response: 334 UGFzc3dvcmQ6 SMTP Command: ZGVzaWdu Response: 235 OK And this is from the service SMTP Response: 250-AUTH=LOGIN Command: AUTH login ZGVzaWduQGlkc21lZGlhLm5ldA== SMTP Response: 334 VXNlcm5hbWU6 SMTP Command: ZGVzaWdu SMTP Response: 334 UGFzc3dvcmQ6 SMTP Response: 535 authentication failed here is the siniffer log SMTP_client: SMTP/CONNECT SMTP_server: 220 myserver.com AAMail SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. SMTP_client: EHLO balt SMTP_server: 250-AUTH=LOGIN & 250 AUTH LOGIN SMTP_client: AUTH LOGIN SMTP_server: 334 VXNlcm5hbWU6 SMTP_client: test@xxxxxx SMTP_server: 334 UGFzc3dvcmQ6 SMTP_client: design SMTP_server: 235 OK SMTP_client: MAIL FROM: <test@xxxxxx> SMTP_server: 250 SMTP_client: RCPT TO: <test@xxxxxx> SMTP_server: 250 SMTP_client: DATA SMTP_server: 354 SMTP_client: . SMTP_server: 250 OK Service SMTP_client: SMTP/CONNECT SMTP_server: 220 myserver.com AAMail SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition [25]/Un=39. SMTP_client: EHLO balt SMTP_server: 250-AUTH=LOGIN & 250 AUTH LOGIN SMTP_client: AUTH LOGIN aWRzbWVkaWEubmV0XGRlc2lnbg== [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 SMTP_client: design SMTP_server: 334 UGFzc3dvcmQ6 SMTP_client: SMTP_server: 535 authentication failed "sloan" wrote: Quote: > I would redo the Outlook setup just to verify your username/password are > correct. > > I don't think its a DotNet issue, I think its a simple issue like the wrong > port or wrong userName/password combination. > > > > > "sloan" <sloan@xxxxxx> wrote in message > news:u5WgjkkWJHA.1328@xxxxxx Quote: > > Then I don't know. > > > > Did you wire up SSL just to make sure? > > > > Is your Outlook setup for Exchange Server or SMTP? > > > > ......... > > > > My only leftover advice is to delete (or create a new) profile in Outlook, > > and work through (re setup) the smtp setup settings to make sure you're > > not missing something. > > > > > > > > > > > > > > "Glenn" <Glenn@xxxxxx> wrote in message > > news:9EB10732-577D-4632-B011-C3EB17B20B58@xxxxxx Quote: > >> it failed against my smtp server same error message. SMTP_server: 535 > >> authentication failed. I know the code I have can work. I tried it > >> againt a > >> cox.net server and it sent the email. when I tried it against the other > >> smtp > >> server it failed. but I know the smtp server is working I can do a test > >> send > >> and recive from outlook 2007. and it comes back fine. > >> > >> "sloan" wrote: > >> > >>> Did you try to run my code and see if it failed? > >>> > >>> I'm guessing, but maybe chronological order of the MailMessage and > >>> SmtpClient makes a difference (<<I wouldn't think it would, but it > >>> might....I've seen weird stuff) > >>> ? > >>> Or maybe the constructor I'm using or MailMessage? > >>> > >>> See if my example works, and then if it doesn't, then post the results. > >>> > >>> Are you sure about the port? > >>> ........ > >>> > >>> I have my used my example in 6 different environments > >>> (home/work/staging/production/hosted sites, etc), one of the reasons I > >>> trust > >>> it. > >>> > >>> What is great about my library, is that with a few tweaks of the config > >>> file, you can experiment with NONE/BASIC/SSL. > >>> Try the others ones. > >>> Try to get my code up and running. > >>> > >>> I'm not trying to be argumentative, I'm just trying to help you. > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> "Glenn" <Glenn@xxxxxx> wrote in message > >>> news:EE23F1EF-6C7A-4649-BA15-CE80EE2712AE@xxxxxx > >>> >I lookat at the code it used I am using all the exact settings it is > >>> >for > >>> >the > >>> > message and smtp client settings for basic authentication. > >>> > > >>> > "sloan" wrote: > >>> > > >>> >> This should help you. > >>> >> > >>> >> http://sholliday.spaces.live.com/Blo...842A!138.entry > >>> >> > >>> >> You can download the code and reuse the library ... OR you can at > >>> >> least > >>> >> tweak until you figure out which parameters you need to set. > >>> >> > >>> >> I would reuse the small library. > >>> >> > >>> >> > >>> >> "Glenn" <Glenn@xxxxxx> wrote in message > >>> >> news:9E935E16-0F2A-448B-80DC-E89D0ACEA7C0@xxxxxx > >>> >> >I am having problems Authenticating to my SMTP Server. The code I am > >>> >> >using > >>> >> >is > >>> >> > as follows > >>> >> > > >>> >> > public void SendMail(string fromAddress, string toAddress, string > >>> >> > subject, > >>> >> > string body, string Password) > >>> >> > { > >>> >> > try > >>> >> > { > >>> >> > MailMessage msg = new MailMessage(); > >>> >> > msg.From = new MailAddress(fromAddress); > >>> >> > msg.To.Add(new MailAddress(toAddress)); > >>> >> > msg.Subject = subject; > >>> >> > msg.Body = body; > >>> >> > msg.IsBodyHtml = false; > >>> >> > SmtpClient smtp = new SmtpClient(); > >>> >> > smtp.Host = "myemailserver.net"; > >>> >> > smtp.Port = 25; > >>> >> > > >>> >> > smtp.UseDefaultCredentials = false; > >>> >> > smtp.DeliveryMethod = SmtpDeliveryMethod.Network; > >>> >> > smtp.Credentials = new > >>> >> > System.Net.NetworkCredential("testaccount", "design"); > >>> >> > smtp.EnableSsl = false; > >>> >> > smtp.Send(msg); > >>> >> > //return true; > >>> >> > } > >>> >> > catch (Exception ex) > >>> >> > { > >>> >> > ///Log.Write(ex) > >>> >> > //return false; > >>> >> > > >>> >> > > >>> >> > } > >>> >> > } > >>> >> > > >>> >> > when I view the log on the smtp server I get > >>> >> > > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: SMTP/CONNECT > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 220 > >>> >> > netresolutions.com > >>> >> > AAMail > >>> >> > SMTP ver 3.99.1/Vista*1 SQL Server 2005 Standard Edition > >>> >> > [25]/Un=39. > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: EHLO balt > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 250-AUTH=LOGIN & 250 > >>> >> > AUTH > >>> >> > LOGIN > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: AUTH LOGIN > >>> >> > aWRzbWVkaWEubmV0XGRlc2lnbg== > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 VXNlcm5hbWU6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: design > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 334 UGFzc3dvcmQ6 > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_client: > >>> >> > [12-09 11:08:23] 98.172.47.252: SMTP_server: 535 authentication > >>> >> > failed > >>> >> > > >>> >> > I am far from an expert on SMTP but it appears that it is only > >>> >> > sending > >>> >> > over > >>> >> > the paasword and not the login information. but if I new that for > >>> >> > sure > >>> >> > I > >>> >> > woulnt be here asking. any help would be apprecitated > >>> >> > > >>> >> > I am using VS2008, .net 2.0/3.5, silverlight 2 > >>> >> > thanks > >>> >> > >>> >> > >>> >> > >>> > >>> > >>> > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| General IMAP Authentication Problems | Vista mail | |||
| Spool ID - SmtpClient Class | .NET General | |||
| smtpclient.send failure | PowerShell | |||
| Problems with Vista Kerberos Authentication in AD Domain | Vista networking & sharing | |||
| Security, Certificate and Authentication problems. | Vista General | |||