Click here to Skip to main content
15,909,440 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can I to manipulate dynamically created controls? Pin
PIEBALDconsult22-Feb-12 11:04
mvePIEBALDconsult22-Feb-12 11:04 
AnswerRe: How can I to manipulate dynamically created controls? Pin
BobJanova22-Feb-12 22:57
BobJanova22-Feb-12 22:57 
AnswerRe: How can I to manipulate dynamically created controls? Pin
GParkings22-Feb-12 23:00
GParkings22-Feb-12 23:00 
AnswerRe: How can I to manipulate dynamically created controls? Pin
BillWoodruff24-Feb-12 15:00
professionalBillWoodruff24-Feb-12 15:00 
QuestionHow can we access to an object of a form from another form? Pin
Fred 3422-Feb-12 9:59
Fred 3422-Feb-12 9:59 
AnswerRe: How can we access to an object of a form from another form? Pin
PIEBALDconsult22-Feb-12 10:09
mvePIEBALDconsult22-Feb-12 10:09 
GeneralRe: How can we access to an object of a form from another form? Pin
Fred 3422-Feb-12 11:53
Fred 3422-Feb-12 11:53 
AnswerRe: How can we access to an object of a form from another form? Pin
Wes Aday22-Feb-12 10:32
professionalWes Aday22-Feb-12 10:32 
GeneralRe: How can we access to an object of a form from another form? Pin
Fred 3422-Feb-12 11:51
Fred 3422-Feb-12 11:51 
AnswerRe: How can we access to an object of a form from another form? Pin
Luc Pattyn22-Feb-12 12:12
sitebuilderLuc Pattyn22-Feb-12 12:12 
AnswerRe: How can we access to an object of a form from another form? Pin
hellono122-Feb-12 20:50
hellono122-Feb-12 20:50 
AnswerRe: How can we access to an object of a form from another form? Pin
Quintain26-Feb-12 15:03
Quintain26-Feb-12 15:03 
QuestionRegarding AttributeUsageAttribute.AllowMultiple Pin
PIEBALDconsult22-Feb-12 8:11
mvePIEBALDconsult22-Feb-12 8:11 
QuestionHow to check that dsn which is created used for Sql Server or Access using C# Pin
Awadhendra123422-Feb-12 2:16
Awadhendra123422-Feb-12 2:16 
AnswerRe: How to check that dsn which is created used for Sql Server or Access using C# Pin
PIEBALDconsult22-Feb-12 2:56
mvePIEBALDconsult22-Feb-12 2:56 
GeneralRe: How to check that dsn which is created used for Sql Server or Access using C# Pin
Awadhendra123422-Feb-12 3:24
Awadhendra123422-Feb-12 3:24 
GeneralRe: How to check that dsn which is created used for Sql Server or Access using C# Pin
PIEBALDconsult22-Feb-12 4:00
mvePIEBALDconsult22-Feb-12 4:00 
QuestionDetect Marked Checkbox using OCR Pin
Zeyad Jalil22-Feb-12 2:12
professionalZeyad Jalil22-Feb-12 2:12 
AnswerRe: Detect Marked Checkbox using OCR PinPopular
enhzflep22-Feb-12 4:44
enhzflep22-Feb-12 4:44 
GeneralRe: Detect Marked Checkbox using OCR Pin
Zeyad Jalil22-Feb-12 20:29
professionalZeyad Jalil22-Feb-12 20:29 
GeneralRe: Detect Marked Checkbox using OCR Pin
enhzflep22-Feb-12 20:43
enhzflep22-Feb-12 20:43 
Questionsmtp unknown sender Pin
CS3421-Feb-12 23:23
CS3421-Feb-12 23:23 
Hello guys!

I am trying to use the following code to send an email to a mail server over a tcp connection. The code works great, however, when I try to send an email to someone, the receipt of my Email alwyes gets unknown sender(From). Am I missing something?

C#
TcpClient SmtpServ = new TcpClient("smtp.my.com", 25);
            string Data;
            byte[] szData;
            string CRLF = "\r\n";
 
            try
            {
                // initialization
                NetworkStream NetStrm = SmtpServ.GetStream();
                StreamReader RdStrm = new StreamReader(SmtpServ.GetStream());
                Console.WriteLine(RdStrm.ReadLine());
 
                // say hello to server and send response into log report
                Data = "HELO server" + CRLF;
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
                // send sender data
                Data = "MAIL From:" + " me@test.com" + CRLF;
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
 
                // send receiver data
                Data = "RCPT TO: " + "me@my.net" + CRLF;
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
 
                // send DATA
                Data = "DATA" + CRLF;
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
 
                // send content data
                Data = "SUBJECT: my subject\r\n\r\n";
                Data += "Hello there!\r\n";
                Data += ".\r\n";
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
 

                // quit from server SMTP
                Data = "QUIT" + CRLF;
                szData = System.Text.Encoding.ASCII.GetBytes(Data.ToCharArray());
                NetStrm.Write(szData, 0, szData.Length);
                Console.WriteLine(RdStrm.ReadLine());
 
                // close connection
                NetStrm.Close();
                RdStrm.Close();
                Console.WriteLine("Close connection");
                Console.WriteLine("Send mail successly..");
 
            }
            catch (InvalidOperationException err)
            {
                Console.WriteLine("Error: " + err.ToString());
            }


Thanks,
AnswerRe: smtp unknown sender Pin
Richard MacCutchan22-Feb-12 3:14
mveRichard MacCutchan22-Feb-12 3:14 
Questionadd application to \\root\SecurityCenter2\antispywareproduct as antispyware Pin
abhinish21-Feb-12 23:12
abhinish21-Feb-12 23:12 
Questionhow can i scann image from scanner in C# Pin
A7mad_21-Feb-12 22:55
A7mad_21-Feb-12 22:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.